[java] BQ: use logical type in avro schema factory on write #33163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when writing to BQ with avro, if the table schema contains
DATE
,TIME
,TIMESTAMP
columns, the default schema factory should create avro fields with matching logical type.There is still an issue with
DATETIME
:BigQueryAvroUtils::toGenericAvroSchema
favors generating schema for the reading side and generates an avro field withstring(datetime)
type. This can't be used on write (expectinglong(local-timestamp-millis)
orlong(local-timestamp-micros)
).See note in doc