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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL parse error with from key word #187

Closed
jackpgao opened this issue May 15, 2020 · 2 comments · Fixed by #257
Closed

SQL parse error with from key word #187

jackpgao opened this issue May 15, 2020 · 2 comments · Fixed by #257
Assignees

Comments

@jackpgao
Copy link

jackpgao commented May 15, 2020

$columns(
    from_ip,
    count() as total)
FROM $table
WHERE $timeFilter
  • with above SQL, it generate to
SELECT t, groupArray((from_ip, total)) AS groupArr FROM ( SELECT (intDiv(toUInt32(datetime), 10) * 10) * 1000 AS t, from_ip, count() as total from_ip,     count() as total) FROM xxx WHERE date >= toDate(1589501834) AND datetime >= toDateTime(1589501834) AND date >= toDate(1589501834) AND datetime >= toDateTime(1589501834) GROUP BY t, from_ip ORDER BY t, from_ip) GROUP BY t ORDER BY t
  • this part is wrong.
count() as total from_ip,     count() as total)
  • version: 1.9.5
  • Grafana: v6.7.1 (ca6d08d5cb)
@jackpgao jackpgao changed the title SQL parse error with from key word SQL parse error with from key word May 15, 2020
@Slach Slach closed this as completed in 5fbd3c5 Jun 25, 2020
@Slach
Copy link
Collaborator

Slach commented Jun 25, 2020

Dear @jackpgao please look at last master and check your query

@Slach Slach self-assigned this Jun 25, 2020
@jackpgao
Copy link
Author

jackpgao commented Jun 28, 2020

It works~~
Thanks~

Slach added a commit to Altinity/grafana-plugin-repository that referenced this issue Jul 7, 2020
# 2.0.2 (2020-07-07)

## Enhancements:
* add alerts support for Windows and MacOSX
* improve ad-hoc filters for query field values as `SELECT DISTINCT field AS value FROM db.table LIMIT 300`, Altinity/clickhouse-grafana#222
* add the ability to multiple JOIN parsing Altinity/clickhouse-grafana#206
* multiple improvements for docker-compose environments, add automatic dashboards and data source provisions which help to reproduce most of the corner cases which happens in Grafana + ClickHouse

## Fixes:
* apply a workaround for UTC timezone for Date and DateTime columns in grafana dashboards Altinity/clickhouse-grafana#117
* clear documentation about timestamp term for $from and $to Altinity/clickhouse-grafana#115
* fix AST parsing corner case in `WHERE [test, 'test']` "," was skipped, fix ah-doc AST FROM recursive parsing Altinity/clickhouse-grafana#99
* fix corner cases for table functions parsing when Adhoc filter applied Altinity/clickhouse-grafana#130
* fix multiple grammar issues in README.md
* fix convert rules for Float, Decimal columns from Clickhouse to Grafana Table plugin Altinity/clickhouse-grafana#199
* fix corner cases when Grafana Template variable value represented as an array of strings Altinity/clickhouse-grafana#169
* fix AST parsing corner cases for $macroFunctions correct position for FROM statement Altinity/clickhouse-grafana#187

Signed-off-by: Eugene Klimov <eklimov@altinity.com>
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 a pull request may close this issue.

2 participants