You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that if table contains some specific for locality columns or some multiwords column (for example column with name "creation date"), query builder does not wrap them in double quotes.
Look at example request. In rawSql attribute - all field names without double quotes
{"request": {"url": "api/ds/query","method": "POST","data": {"queries": [{"datasource": {"type": "grafana-clickhouse-datasource","uid": "UID"},"builderOptions": {"mode": "aggregate","database": "jira_db","table": "report01","fields": ["Дата создания запроса"],"metrics": [{"aggregation": "count","field": "Стрим"}],"timeFieldType": "DateTime64(3)","timeField": "timestamp","filters": [{"filterType": "custom","key": "Дата закрытия запроса","type": "datetime","condition": "AND","operator": "WITH IN DASHBOARD TIME RANGE","restrictToFields": [{"name": "Дата создания запроса","type": "DateTime64(3)","label": "Дата создания запроса","picklistValues": []},{"name": "Дата закрытия запроса","type": "Nullable(DateTime64(3))","label": "Дата закрытия запроса","picklistValues": []},{"name": "Срок исполнения","type": "Nullable(DateTime64(3))","label": "Срок исполнения","picklistValues": []},{"name": "Дата завершения (План)","type": "Nullable(DateTime64(3))","label": "Дата завершения (План)","picklistValues": []},{"name": "Дата обновления запроса","type": "DateTime64(3)","label": "Дата обновления запроса","picklistValues": []},{"name": "Дата начала суперспринта","type": "Nullable(DateTime64(3))","label": "Дата начала суперспринта","picklistValues": []},{"name": "timestamp","type": "DateTime64(3)","label": "timestamp","picklistValues": []}]}],"limit": 100,"orderBy": [{"name": "Дата создания запроса","dir": "ASC"}],"groupBy": ["Дата создания запроса"]},"expand": false,"format": 1,"meta": {"builderOptions": {"database": "jira_db","fields": [],"filters": [{"key": "Дата создания запроса","operator": "WITH IN DASHBOARD TIME RANGE","type": "datetime"}],"limit": 100,"metrics": [{"aggregation": "count","field": "Ключ запроса"}],"mode": "trend","table": "report01","timeField": "Дата закрытия запроса","timeFieldType": "Nullable(DateTime64(3))"},"timezone": "Europe/Moscow"},"queryType": "builder","rawSql": "SELECT Дата создания запроса, count(Команды стрима) FROM \"jira_db\".\"report01\" WHERE ( Дата закрытия запроса >= $__fromTime AND Дата закрытия запроса <= $__toTime ) GROUP BY Дата создания запроса ORDER BY Дата создания запроса ASC LIMIT 100","refId": "A","selectedFormat": 1,"datasourceId": 1732,"intervalMs": 3600000,"maxDataPoints": 846}],"range": {"from": "2023-09-27T08:40:05.379Z","to": "2023-10-04T08:40:05.379Z","raw": {"from": "now-7d","to": "now"}},"from": "1695804005379","to": "1696408805379"},"hideFromInspector": false},"response": {"message": "An error occurred within the plugin","messageId": "plugin.downstreamError","statusCode": 500,"traceID": ""}}
Expected that all fields should wraps in double quotes in all parts of sql request (field names in SELECT, WHERE, GROUP BY, HAVING, ORDER BY sections) in all querybuilder modes ("Format" and "Show as" plugin form field).
Grafana version: v9.3.8
Plugin version: 3.3.0
The text was updated successfully, but these errors were encountered:
This appears to be similar (but also opposite) to #484
I think we need to simply add quotes whenever a space is present, but also skip quotes if a function is present (so users can still write in their own columns with functions)
If you still have an issue with v4 feel free to open another issue and link to this one. Keep in mind you may have to manually add your own '' quotes depending on the input.
Hello, colleagues.
I found that if table contains some specific for locality columns or some multiwords column (for example column with name "creation date"), query builder does not wrap them in double quotes.
Look at example request. In rawSql attribute - all field names without double quotes
Expected that all fields should wraps in double quotes in all parts of sql request (field names in SELECT, WHERE, GROUP BY, HAVING, ORDER BY sections) in all querybuilder modes ("Format" and "Show as" plugin form field).
The text was updated successfully, but these errors were encountered: