Skip to content

Consolidate and document SQL AST shims#22094

Open
alamb wants to merge 6 commits into
apache:mainfrom
alamb:alamb/comments_about_sql_copy
Open

Consolidate and document SQL AST shims#22094
alamb wants to merge 6 commits into
apache:mainfrom
alamb:alamb/comments_about_sql_copy

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented May 10, 2026

Which issue does this PR close?

Rationale for this change

While upgrading sqlparser, it was not clear why there were feature gates for the sql feature: https://github.com/apache/datafusion/pull/22069/changes#r3204705488

There is a mode to avoid the sqlparser dependency, added by @timsaucer in

I think this feature makes sense but it is a little hard to understand because it is implemented with a bunch of #[cfg(not(feature = "sql"))] and there is no central place that explains the design.

What changes are included in this PR?

  1. Consolidate the SQL AST shim structures in a separate module
  2. Document the design so it is easier to understand

Are these changes tested?

Yes by CI

Are there any user-facing changes?

@github-actions github-actions Bot added the logical-expr Logical plan and expressions label May 10, 2026
Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Thanks @alamb

@alamb alamb marked this pull request as ready for review May 11, 2026 12:52
}
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this stuff is all moved to sql.rs and I put a module level comment on it

@alamb alamb added the documentation Improvements or additions to documentation label May 11, 2026
Copy link
Copy Markdown
Member

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

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

This is a nice cleanup, and something I wasn't 100% happy with when I did it. Thank you!

// specific language governing permissions and limitations
// under the License.

//! Local copies of [`sqlparser::ast`] structures
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the documentation that explains what is going on

@alamb alamb enabled auto-merge May 11, 2026 13:17
@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 11, 2026

Since I think this will conflict with @andygrove 's upgrade of sqlparser and I don't think it will be potentially controversial, I am mergeing now

@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label May 11, 2026
@alamb alamb added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 11, 2026
@alamb alamb added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alamb alamb added this pull request to the merge queue May 11, 2026
@alamb alamb removed this pull request from the merge queue due to a manual request May 11, 2026
@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 11, 2026

@alamb alamb added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants