Skip to content

Upgrade to sqlparser 0.61.0 - #20177

Merged
alamb merged 11 commits into
apache:mainfrom
alamb:alamb/test_sqlparser_update
Feb 23, 2026
Merged

Upgrade to sqlparser 0.61.0#20177
alamb merged 11 commits into
apache:mainfrom
alamb:alamb/test_sqlparser_update

Conversation

@alamb

@alambalamb commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

DRAFT until SQL parser is released

Which issue does this PR close?

Rationale for this change

Keep up to date with dependencies

I think @Samyak2 specifically would like access to the : field syntax

What changes are included in this PR?

  1. Update to 0.61.0
  2. Update APIs

Are these changes tested?

Yes by existing tests

Are there any user-facing changes?

New dependency

@github-actionsgithub-actionsBot added the sql SQL Planner label Feb 5, 2026
@alamb

alamb commented Feb 5, 2026

Copy link
Copy Markdown
ContributorAuthor

There are a few sqllogictest errors like this

External error: 35 errors in file /Users/andrewlamb/Software/datafusion2/datafusion/sqllogictest/test_files/map.slt
1. statement failed: DataFusion error: SQL error: ParserError("Expected: ), found: { at Line: 3, Column: 8")
[SQL] CREATE TABLE map_array_table_1
AS VALUES
(MAP {1: [1, NULL, 3], 2: [4, NULL, 6], 3: [7, 8, 9]}, 1, 1.0, '1'),
(MAP {4: [1, NULL, 3], 5: [4, NULL, 6], 6: [7, 8, 9]}, 5, 5.0, '5'),
(MAP {7: [1, NULL, 3], 8: [9, NULL, 6], 9: [7, 8, 9]}, 4, 4.0, '4')
;
at /Users/andrewlamb/Software/datafusion2/datafusion/sqllogictest/test_files/map.slt:18

@alamb
alambforce-pushed the alamb/test_sqlparser_update branch from c95affc to 93fa56eCompareFebruary 6, 2026 13:11
@github-actionsgithub-actionsBot added optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) common Related to common crate labels Feb 6, 2026
@alamb

alamb commented Feb 6, 2026

Copy link
Copy Markdown
ContributorAuthor

I had Codex make up a DataFusion specific dialect to get the tests passing. I now need to clean it up, Occam's razor style

@Samyak2

Copy link
Copy Markdown
Contributor

Should we perhaps consider the errors as bugs in GenericDialect instead? There's some SQL that was previously parsed successfully by GenericDialect but fails now -- sounds like something to fix

@Samyak2

Copy link
Copy Markdown
Contributor

I have an issue and a PR for this upstream: apache/datafusion-sqlparser-rs#2204 and apache/datafusion-sqlparser-rs#2205

Seems to fix all the 35 errors here

@alamb

alamb commented Feb 6, 2026

Copy link
Copy Markdown
ContributorAuthor

Should we perhaps consider the errors as bugs in GenericDialect instead? There's some SQL that was previously parsed successfully by GenericDialect but fails now -- sounds like something to fix

Yes, likely -- this is great news -- thank you @Samyak2

@alamb
alambforce-pushed the alamb/test_sqlparser_update branch from 93fa56e to 8bda485CompareFebruary 6, 2026 21:00
@github-actionsgithub-actionsBot removed optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) common Related to common crate labels Feb 6, 2026
@alamb
alambforce-pushed the alamb/test_sqlparser_update branch from 8bda485 to 315e7c0CompareFebruary 6, 2026 21:13
@alamb
alambforce-pushed the alamb/test_sqlparser_update branch from 315e7c0 to 0461c5aCompareFebruary 6, 2026 21:13
@github-actionsgithub-actionsBot added the sqllogictest SQL Logic Tests (.slt) label Feb 6, 2026
}) => {
if temporary {
return not_impl_err!("Temporary tables not supported")?;
return not_impl_err!("Temporary tables not supported");

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This is a drive by cleanup -- no need to return and ? -- just return is fine

@alamb

alamb commented Feb 6, 2026

Copy link
Copy Markdown
ContributorAuthor

Should we perhaps consider the errors as bugs in GenericDialect instead? There's some SQL that was previously parsed successfully by GenericDialect but fails now -- sounds like something to fix

Yes, likely -- this is great news -- thank you @Samyak2

Thanks again @Samyak2 -- I updated this branch to include the fix (and the 0.61.0 Release candidate) and all the tests pass now.

Thanks 🙏 !

@alamb
alamb marked this pull request as ready for review February 10, 2026 17:01
@alamb
alamb marked this pull request as draft February 10, 2026 17:01
@alamb
alamb marked this pull request as ready for review February 10, 2026 18:10
@alamb

Copy link
Copy Markdown
ContributorAuthor

@jonahgao I wonder if you have a few minutes to review this PR?

@alamb
alamb requested a review from adriangbFebruary 12, 2026 20:32

@jonahgaojonahgao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, thanks @alamb

// Process distinct clause
let plan = match select.distinct {
None => Ok(plan),
Some(Distinct::All) => Ok(plan),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add a new slt test for this, e.g., select all * from test? It’s equivalent to select * from test.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This is a good idea. I added this in 0131226

I also double checked and this syntax is also checked in the extended sqllogictests: https://github.com/search?q=repo%3Aapache%2Fdatafusion-testing%20%22select%20all%20*%22&type=code

And I ran that locally as well and verified it passes

INCLUDE_SQLITE=true cargo test --profile release-nonlto --test sqllogictests

Comment threaddatafusion/sql/src/statement.rs Outdated
@alamb

Copy link
Copy Markdown
ContributorAuthor

Thanks again @Jefffrey and @jonahgao

@alamb
alamb added this pull request to the merge queueFeb 23, 2026
Merged via the queue into apache:main with commit b9328b9Feb 23, 2026
31 checks passed
@alamb
alamb deleted the alamb/test_sqlparser_update branch February 23, 2026 19:46
de-bgunter pushed a commit to de-bgunter/datafusion that referenced this pull request Mar 24, 2026
DRAFT until SQL parser is released
## Which issue does this PR close?
- part of apache/datafusion-sqlparser-rs#2117
## Rationale for this change
Keep up to date with dependencies
I think @Samyak2 specifically would like access to the `:` field syntax
## What changes are included in this PR?
1. Update to 0.61.0
2. Update APIs ## Are these changes tested?
Yes by existing tests
## Are there any user-facing changes?
New dependency
---------
Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqlSQL PlannersqllogictestSQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@alamb@Samyak2@Jefffrey@jonahgao