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

Parse schema from table metadata #30

Merged
merged 17 commits into from
Nov 30, 2023

Conversation

samansmink
Copy link
Collaborator

This PR changes the way we scan Iceberg tables. Before we would simply scan them as a list of parquet files, using the schema we found in the first parquet file scanned.

Now the iceberg metadata is actually scanned to parse the schema and pass that to the parquet_scan in duckdb using the schema parameter: duckdb/duckdb#9123

This effectively adds support for schema evolution and resolves issues where the parquet schema is different from the iceberg schema.

To test it, the spark-based test data generation script was updated to include schema evolution. Note that it is not yet run from CI, but that will follow soon in conjunction with the REST catalog support and the testing infrastructure added in #27

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Looking good @samansmink

src/common/schema.cpp Outdated Show resolved Hide resolved
auto digits = StringUtil::Split(raw_digits, ',');
D_ASSERT(digits.size() == 2);

auto width = std::stoi(digits[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Checked if it strips whitespace and it looks like it does.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So this is good as is right?

src/common/iceberg.cpp Show resolved Hide resolved
@samansmink samansmink removed the request for review from Tishj November 28, 2023 13:35
src/common/iceberg.cpp Outdated Show resolved Hide resolved
@samansmink samansmink merged commit e16988b into duckdb:main Nov 30, 2023
7 checks passed
@samansmink samansmink deleted the parse_json_schema branch November 30, 2023 10:22
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.

3 participants