Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tdengine): fix SQL template errors #11266

Merged
merged 5 commits into from Jul 14, 2023

Conversation

lafirest
Copy link
Member

@lafirest lafirest commented Jul 13, 2023

  1. supports multi-table insert
  2. supports constructing subtable names by mixed prefixes and placeholders

Fixes EMQX-10545

Summary

馃 Generated by Copilot at fef5087

Refactored and simplified the SQL placeholder processing logic in emqx_bridge_tdengine_connector.erl. Renamed a function for clarity.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@lafirest lafirest changed the base branch from master to release-51 July 13, 2023 08:33
@lafirest lafirest marked this pull request as ready for review July 13, 2023 08:42
@lafirest lafirest requested a review from a team as a code owner July 13, 2023 08:42
paulozulato
paulozulato previously approved these changes Jul 13, 2023

`insert into table_${topic} values (${ts}, '${id}', '${topic}')`

Note: This is a breaking change, at the former, the string-type values are automatically quoted, bu now, you should manually quote them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: ... bu now...

fun({Table, Size}) ->
?assertMatch(
[[Size]],
connect_and_query(Config, "SELECT COUNT(1) FROM " ++ Table)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you changed from SELECT COUNT(1) to SELECT 1 on line 489. Maybe use it here as well?

thalesmg
thalesmg previously approved these changes Jul 13, 2023
Copy link
Contributor

@thalesmg thalesmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this'll probably require amending the docs for this bridge, as it currently claims it supports prepared statements and now it won't support them anymore.

changes/ee/fix-11266.en.md Outdated Show resolved Hide resolved
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
@HJianBo HJianBo dismissed stale reviews from thalesmg and paulozulato via c746c85 July 14, 2023 01:18
@lafirest lafirest merged commit f6834b3 into emqx:release-51 Jul 14, 2023
117 checks passed
@lafirest lafirest deleted the fix/influxdb-ph branch July 14, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants