Skip to content

fix(validation): reject INTERVAL, empty IN, alias, and bare DISTINCT - #777

Merged
jbonofre merged 1 commit into
apache:mainfrom
vigneshio:fix/validation-reject-portable-sql-constructs
Nov 20, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
vigneshio:fix/validation-reject-portable-sql-constructs

Conversation

@vigneshio

Copy link
Copy Markdown
Contributor

sqlglot parses eight of the fifteen expressions in compliance/expressions/invalid.txt, so validate.py accepted portable sql that the grammar and expression_language.md reject: juxtaposition (a b, a IS), an empty IN list, INTERVAL date arithmetic, and DISTINCT with no argument.

This walks the tree after a successful OSSIE_SQL_2026 parse and rejects those constructs. Both fixture files are now run from validation/tests/. SELECT a FROM t stays deferred (#698). Postgres INTERVAL and BigQuery DATE_ADD(..., INTERVAL ...) dialect entries are unchanged.

sqlglot parses eight of the fifteen expressions in
compliance/expressions/invalid.txt, so validate.py printed Validation
PASSED for portable sql that the grammar and expression_language.md
reject: juxtaposition (`a b`, `a IS`), an empty IN list, INTERVAL date
arithmetic, and DISTINCT with no argument.

The grammar tests already run both fixture files. Wire them into the
validator tests too, and after a successful parse of OSSIE_SQL_2026 walk
the tree for those constructs. SELECT a FROM t stays deferred. Vendor
dialects are left alone, so a Postgres INTERVAL or BigQuery DATE_ADD
with INTERVAL still passes.
@jbonofre
jbonofre self-requested a review November 20, 2026 13:37

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @vigneshio!

That's cool to close these OSSIE_SQL_2026 gaps and wiring compliance/expressions/ into validation/tests/.

@jbonofre
jbonofre merged commit 3719487 into apache:main Nov 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants