-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[HUDI-6728] Update BigQuery manifest sync to support schema evolution #9482
[HUDI-6728] Update BigQuery manifest sync to support schema evolution #9482
Conversation
if (definition.getSchema() != null && definition.getSchema().equals(finalSchema)) { | ||
return; // No need to update schema. | ||
} | ||
Table updatedTable = existingTable.toBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarification: We are creating the table by providing a schema without partition fields, but updating it with the schema by adding the partition fields, are we sure it's the right thing ? Without manifests and using ExternalTableDefinition, we use the schema without partition fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when updating the schema, BigQuery expects all fields including the partition fields to be present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add java docs around this in lines 163 ish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm overall, just left 1 comment if it can be addressed.
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java
Outdated
Show resolved
Hide resolved
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java
Show resolved
Hide resolved
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java
Outdated
Show resolved
Hide resolved
if (definition.getSchema() != null && definition.getSchema().equals(finalSchema)) { | ||
return; // No need to update schema. | ||
} | ||
Table updatedTable = existingTable.toBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add java docs around this in lines 163 ish.
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java
Outdated
Show resolved
Hide resolved
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java
Outdated
Show resolved
Hide resolved
@hudi-bot run azure |
bd99a6c
to
51c9a62
Compare
@hudi-bot run azure |
…apache#9482) Adds schema evolution support to the BigQuerySyncTool by converting the Hudi schema into the BigQuery Schema format when creating and updating the table.
Change Logs
Adds schema evolution support to the BigQuerySyncTool by converting the Hudi schema into the BigQuery Schema format when creating and updating the table.
Impact
Ensures users can properly query their tables even after updating the schema of the tables.
Risk level (write none, low medium or high below)
Low, this only impacts users of the new manifest-style table in BigQuery
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change
ticket number here and follow the instruction to make
changes to the website.
Contributor's checklist