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

Improve BQ <-> Avro conversions #32482

Merged
merged 4 commits into from
Sep 27, 2024
Merged

Conversation

RustedBones
Copy link
Contributor

Extracted from #32360

This change-set focuses on conversions between BQ TableSchema/TableRow and Avro Schema/GenericRecord

Fix #20677

@RustedBones RustedBones changed the title Improve BQ avro handling Improve BQ <-> Avro conversions Sep 17, 2024
@RustedBones RustedBones force-pushed the bq-avro-schema branch 2 times, most recently from c2055eb to 55017e6 Compare September 17, 2024 14:03
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java.
R: @johnjcasey for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

Thanks for this effort, went through once and had comments. For BQIO changes, @ahmedabu98 could you please also take a look? Thanks!

@RustedBones RustedBones force-pushed the bq-avro-schema branch 2 times, most recently from e22368a to a4ad8d3 Compare September 20, 2024 10:03
Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

+1 thanks for this effort. Left a few comments but the rest looks great

Comment on lines +104 to +106
// in Extract Jobs, it always uses the Avro logical type
// we may have to change this if we move to EXPORT DATA
return LogicalTypes.timestampMicros().addToSchema(SchemaBuilder.builder().longType());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

useAvroLogicalTypes has a different behavior when used in extract job vs export data for TIMESTAMP columns.

Currently, beam's implementation of query is relying on temp table + extract job, so we don't have to handle this discrepancy.

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

LGTM

@ahmedabu98
Copy link
Contributor

Failing test is unrelated, merging now

@ahmedabu98 ahmedabu98 merged commit ee604a5 into apache:master Sep 27, 2024
16 of 18 checks passed
@RustedBones RustedBones deleted the bq-avro-schema branch October 21, 2024 09:32
reeba212 pushed a commit to reeba212/beam that referenced this pull request Dec 4, 2024
* Improve BQ avro handling

* Include minimal changeset

* Apply review comments

* Streamline avro type conversion with beam schema
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.

Avro/BigQuery disagreement on DATE type representation
3 participants