Skip to content

Support SELECT without a FROM clause#4199

Open
arnaud-lacurie wants to merge 4 commits into
FoundationDB:mainfrom
arnaud-lacurie:support-select-without-from
Open

Support SELECT without a FROM clause#4199
arnaud-lacurie wants to merge 4 commits into
FoundationDB:mainfrom
arnaud-lacurie:support-select-without-from

Conversation

@arnaud-lacurie
Copy link
Copy Markdown
Collaborator

Summary

  • SELECT 'bob', SELECT 1 + 1, and similar constant-expression queries are now supported
  • The grammar already allowed a missing FROM clause; the planner was rejecting it with UNSUPPORTED_QUERY
  • Fix: when no FROM is present, synthesize a single-row source (ExplodeExpression over a one-element array) so the existing Cascades implementation rules match and execute unchanged

Test plan

  • New YAML integration test (select-without-from.yamsql) covering string literal, integer literal, arithmetic expression, multiple columns, and boolean literal

Constant-expression queries like SELECT 'bob' or SELECT 1 + 1 are now
accepted. When no FROM clause is present, the planner synthesizes a
single-row source (ExplodeExpression over a one-element array) so that
the existing Cascades rules can plan and execute the query unchanged.
@arnaud-lacurie arnaud-lacurie added the enhancement New feature or request label May 23, 2026
@arnaud-lacurie arnaud-lacurie marked this pull request as ready for review May 23, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant