Skip to content

Simplify EXISTS without FROM clause for E6 dialect#220

Merged
deepakdixit-e6x merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/exists-without-from-simplification
Feb 26, 2026
Merged

Simplify EXISTS without FROM clause for E6 dialect#220
deepakdixit-e6x merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/exists-without-from-simplification

Conversation

@tkaunlaky-e6
Copy link

Summary

  • Added optional simplification of EXISTS (SELECT 1 WHERE condition) without a FROM clause to just the condition expression
  • Gated behind SIMPLIFY_EXISTS_WITHOUT_FROM environment variable (default: disabled)
  • EXISTS with FROM clause and higher-order function form (exists(array, lambda)) are unaffected

Test plan

  • Added test: simple EXISTS without FROM simplified when env flag is set
  • Added test: complex query with mixed EXISTS (with/without FROM) — only the one without FROM is simplified
  • Added test: without env flag, EXISTS without FROM is preserved as-is

When SIMPLIFY_EXISTS_WITHOUT_FROM env var is set to true,
EXISTS (SELECT 1 WHERE condition) without a FROM clause is
simplified to just the condition expression. This handles
queries where EXISTS is used as a conditional wrapper rather
than a true subquery predicate.
@deepakdixit-e6x deepakdixit-e6x merged commit 2fccb85 into e6data:main Feb 26, 2026
6 checks passed
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 this pull request may close these issues.

2 participants