-
Notifications
You must be signed in to change notification settings - Fork 121
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] in SQL query, treat --
inside quotes not as comment
#374
Comments
thanks a lot for reporting |
Also, could you provide, SQL query example when you need |
Simplified use case: see the My real use case looks like this: select timestamp, suite, case, duration, result, log, failure from my_db.my_table
where
timestamp >= $from and timestamp <= $to
and business in ($business)
and system in ($system)
and suite in ($suite)
and case in ($case)
and result in ($result)
and env='$env'
order by timestamp desc
limit $limit It happens in the It's a Pytest feature to create name for parametrized case by connecting parameter values with cases are like:
Thanks. I'll fill some test cases and run |
Just added test case and used |
What can be published for this special character? It seems that the clickHouse plugin has not been published for a long time |
# 2.4.0 (2021-11-29) ## Enhancement: * Add support for Grafana 8.x unified alerts, fix Altinity/clickhouse-grafana#380 * Add TLS support for backend alerts part of plugin Altinity/clickhouse-grafana#356 (comment) * Add $naturalTimeSeries macro, look details in https://github.com/Vertamedia/clickhouse-grafana/pull/89/files#diff-cd9133eda7b58ef9c9264190db4534a1be53216edbda9ac57256fbd800368c03R383-R412 * Update golang-plugin-sdk-go to latest version * Properly format Value in Table format, look details Altinity/clickhouse-grafana#379 * Remove toDateTime64 casting for column when time column is already DateTime64 to improve performance. Change test to ensure the casting is removed from the query, fix Altinity/clickhouse-grafana#360 * implements `$timeFilter64ByColumn(column_name)` macro, fix Altinity/clickhouse-grafana#343 ## Fixes: * implements properly GET and POST support for alert queries, fix Altinity/clickhouse-grafana#353 * SQL syntax highlight now works always, fix Altinity/clickhouse-grafana#174, fix Altinity/clickhouse-grafana#381 * fix Altinity/clickhouse-grafana#376, * fix negative behavior for $perSecondColumns Altinity/clickhouse-grafana#337 * fix Altinity/clickhouse-grafana#374, ignore `--` inside quotas as comment
behavior now
--
within quotes is also treated as comment. This brings unexpected truncation of query.[('name1', 'id1', 'score1'), ('name2', 'id2', 'score2'), ('name3', '', 'score3')]
, case name will become likename1-id1-score1
. Say ifid
is omitted for the 3rd case, case name then becomesname3--score3
, then in query:SELECT * FROM my_table WHERE case='name3--score3'
SELECT * FROM my_db.my_table WHERE case='name3
desired behavior
SELECT * FROM my_table WHERE case='name3--score3'-- some comment
SELECT * FROM my_db.my_table WHERE case='name3--score3'
proposed change
https://github.com/delphid/clickhouse-grafana/blob/commentRe/src/scanner.ts#L304
demo
If that seems alright I'd like to submit a PR
The text was updated successfully, but these errors were encountered: