Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for DuckDB Union datatype #1322

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

gstvg
Copy link
Contributor

@gstvg gstvg commented Jun 24, 2024

e.g. CREATE TABLE tbl1 (u UNION(num INTEGER, str VARCHAR));

https://duckdb.org/docs/sql/data_types/union.html

@coveralls
Copy link

coveralls commented Jun 24, 2024

Pull Request Test Coverage Report for Build 9651403373

Details

  • 93 of 94 (98.94%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 89.039%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 15 16 93.75%
Totals Coverage Status
Change from base Build 9633122504: 0.03%
Covered Lines: 26369
Relevant Lines: 29615

💛 - Coveralls


self.expect_token(&Token::LParen)?;

let fields = self.parse_comma_separated0(|p| {
Copy link
Contributor Author

@gstvg gstvg Jun 24, 2024

Choose a reason for hiding this comment

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

Zero field unions are invalid on DuckDB and don't even parse. Should we error here using parse_comma_separated or let downstream users handle it?

https://shell.duckdb.org/#queries=v0,create-table-tbl1-(u-union()-)~

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is fine to return error here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

👍

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9664186307

Details

  • 88 of 89 (98.88%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 89.037%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 15 16 93.75%
Totals Coverage Status
Change from base Build 9633122504: 0.03%
Covered Lines: 26364
Relevant Lines: 29610

💛 - Coveralls

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Likewise -- looks good to me -- thank you @iffyio and @gstvg

@alamb alamb merged commit f9ab8dc into apache:main Jun 27, 2024
10 checks passed
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.

5 participants