Query error reasons
Query syntax error
Your warehouse could not run the query because the SQL has a syntax error.
Reason in E1005 | Diagnostic code | Who can fix it | Does a retry help? |
|---|---|---|---|
QUERY_INVALID | DBN-QRY-001 | Your admin | No |
What this means
Your warehouse could not run the query because the SQL has a syntax error. The warehouse parsed the SQL of the metric and rejected it. This includes a wrong function name, a type mismatch and a column that is not in the GROUP BY on some engines.
What people see
| Who | Message | Next step |
|---|---|---|
| Admin or API caller | The data source could not run this query. It has a syntax error. | Ask your admin to fix the SQL of this metric. |
| Embed viewer | This chart has a data setup problem. | Contact your admin. |
How to fix it
- Open the metric and its SQL.
- Fix the SQL and run it.
- Save the metric.
Warehouse codes behind it
| Warehouse | Codes |
|---|---|
| MySQL, SingleStore | 1064 |
| PostgreSQL, Redshift, CockroachDB | SQLSTATE 42601 |
| ClickHouse | 62 (SYNTAX_ERROR) |
| SQL Server, Microsoft Fabric | 102 |
| Databricks | PARSE_SYNTAX_ERROR |
| BigQuery | invalidQuery |
| Athena | MALFORMED_QUERY |
| Trino | SYNTAX_ERROR, EXPRESSION_NOT_AGGREGATE, TYPE_MISMATCH, AMBIGUOUS_NAME, FUNCTION_NOT_FOUND |
| Elasticsearch | parsing_exception |
Ask for help
Every error has a six-character ref, for example Ref A1B2C3. API callers find it in
details.ref. Search for the ref in Settings > Diagnostics > Logs to see the full log line, or
send the ref and the time of the error to support.