Skip to content

Add FROM-first query syntax support#17410

Open
Abdelrahman-358 wants to merge 2 commits intoapache:masterfrom
Abdelrahman-358:f_from_first_syntax
Open

Add FROM-first query syntax support#17410
Abdelrahman-358 wants to merge 2 commits intoapache:masterfrom
Abdelrahman-358:f_from_first_syntax

Conversation

@Abdelrahman-358
Copy link
Copy Markdown

@Abdelrahman-358 Abdelrahman-358 commented Mar 31, 2026

Description

This PR implements support for the feature proposed in #17336 by introducing FROM-first query syntax.

Usage Examples

-- Current syntax
SELECT temperature, humidity FROM sensors WHERE time >= 10;

-- FROM-first syntax
FROM sensors SELECT temperature, humidity WHERE time >= 10;

-- Quick exploration (omitting SELECT implies SELECT *)
FROM sensors LIMIT 10;

Implementation Approach

  1. Grammar Update
    Add fromFirstQuerySpecification rule to RelationalSql.g4.

  2. AST Builder
    Add visitFromFirstQuerySpecification() in AstBuilder.java, reusing the existing visitQuerySpecification() logic, with handling for the omitted SELECT clause (interpreted as SELECT *).

  3. Testing
    Add unit and integration tests to cover the new syntax scenarios.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@Abdelrahman-358 Abdelrahman-358 marked this pull request as draft March 31, 2026 15:52
@Abdelrahman-358 Abdelrahman-358 marked this pull request as ready for review April 4, 2026 00:47
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.

1 participant