Repository navigation
examples: replace sql_dialect with custom_sql_parser example - #19383
Merged
Merged
Conversation
Updates the example to show that the 'COPY ... STORED AS' use case is already supported by the standard DFParser. This baseline shows the existing example may be confusing as it doesn't highlight a unique need for a custom dialect, preparing for a more distinct replacement.
geoffreyclaude
force-pushed
the
feat/attach
branch
6 times, most recently
from
December 18, 2025 10:20
56db936 to
8b7794c
Compare
Demonstrates extending DataFusion's SQL parser to support: CREATE EXTERNAL CATALOG my_catalog STORED AS <format> LOCATION '<url>' Implements automatic table discovery and programmatic catalog registration.
geoffreyclaude
force-pushed
the
feat/attach
branch
from
December 18, 2025 10:33
8b7794c to
078c358
Compare
martin-g
reviewed
Dec 18, 2025
Jefffrey
approved these changes
Dec 24, 2025
Contributor
|
Thanks @geoffreyclaude & @martin-g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Related to #16756
Rationale for this change
The existing
sql_dialect.rsexample demonstratesCOPY ... STORED AS ..., which is actually already fully supported by the standardDFParser.This PR replaces it with the example from #16756:
CREATE EXTERNAL CATALOG ... STORED AS ... LOCATION ...with automatic table discovery.What changes are included in this PR?
The first commit updates
dialect.rsto show thatDFParseralready handlesCOPY ... STORED AS, making it clear this syntax doesn't need customization.Example output from
cargo run --example sql_ops -- dialect:The second commit adds a new
custom_sql_parser.rsexample that implementsCREATE EXTERNAL CATALOG my_catalog STORED AS <format> LOCATION '<url>'with automatic table discovery from object storage. It also removes the olddialect.rsexample.Are these changes tested?
Yes, the new example is runnable with
cargo run --example sql_ops -- custom_sql_parserand demonstrates the full flow from parsing custom DDL through registering the catalog to querying discovered tables.Example output:
Are there any user-facing changes?
Documentation only. I replaced the
sql_dialect.rsexample withcustom_sql_parser.rsand updated the README. No API changes.