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

[HUDI-6728] Update BigQuery manifest sync to support schema evolution #9482

Merged
merged 9 commits into from
Sep 11, 2023

Conversation

the-other-tim-brown
Copy link
Contributor

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

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

if (definition.getSchema() != null && definition.getSchema().equals(finalSchema)) {
return; // No need to update schema.
}
Table updatedTable = existingTable.toBuilder()
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@rmahindra123 rmahindra123 left a 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.

if (definition.getSchema() != null && definition.getSchema().equals(finalSchema)) {
return; // No need to update schema.
}
Table updatedTable = existingTable.toBuilder()
Copy link
Contributor

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.

@nsivabalan
Copy link
Contributor

@hudi-bot run azure

@nsivabalan
Copy link
Contributor

@hudi-bot run azure

@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@codope codope merged commit 1862f17 into apache:master Sep 11, 2023
28 checks passed
prashantwason pushed a commit that referenced this pull request Sep 13, 2023
…#9482)

Adds schema evolution support to the BigQuerySyncTool by converting 
the Hudi schema into the BigQuery Schema format when creating 
and updating the table.
leosanqing pushed a commit to leosanqing/hudi that referenced this pull request Sep 13, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants