Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E1000 parse-error

SQL could not be parsed.

CodeNameCategoryDefault
E1000parse-errorcorrectnesserror

What it reports

The file contains SQL that sqlsift's parser can't read for the selected dialect.

Example

SELEC id FROM users;
error[E1000]: Parse error: Expected: an SQL statement, found: SELEC
  --> q.sql:1:1
    |
  1 | SELEC id FROM users;
    | ^

Fixed:

SELECT id FROM users;

Notes

  • Check --dialect: MySQL, SQLite or warehouse syntax (Snowflake, BigQuery, Redshift, Databricks) may not parse as PostgreSQL. See Dialects.
  • dbt / Jinja templates parse only with templating on (--templating jinja, automatic in a dbt project); the error then suggests it. With templating on, an error on a template tag shows the tag (found: Jinja expression {{ ... }}): sqlsift can't tell what SQL it expands to there. See dbt and Jinja templates.
  • In TypeScript and JavaScript files, only tagged template literals (sql`...` and the tags in embedded_sql_tags) are parsed as SQL, and the error points into the template. See SQL in TypeScript and JavaScript.
  • If the SQL is valid for your database, please open an issue. Meanwhile, -- sqlsift:disable-file or ignore skips the file.

Configuring

# sqlsift.toml
[rules]
parse-error = "warn"   # or "off"

Or for a single line: -- sqlsift:disable E1000. The examples use the schema on the Rules page.