-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove json avro schema converter hack #9232
Conversation
* https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-avro#logical_types Replace | ||
* date-time by timestamp | ||
*/ | ||
textJson = textJson.replace("\"format\":\"date-time\"", "\"format\":\"timestamp-micros\""); |
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.
This is moved to getBigQuerySchema
because this is only needed in the BigQuery schema.
@@ -201,7 +201,6 @@ Schema getSingleFieldType(final String fieldName, | |||
if (fieldDefinition.has("format")) { | |||
final String format = fieldDefinition.get("format").asText(); | |||
fieldSchema = switch (format) { | |||
case "timestamp-micros" -> LogicalTypes.timestampMicros().addToSchema(Schema.create(Schema.Type.LONG)); |
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.
This was the hack that should not be added in the first place. Json schema does not have such format. This is an Avro format.
/test connector=connectors/destination-bigquery
|
/test connector=connectors/destination-bigquery-denormalized
|
/test connector=connectors/destination-bigquery
|
/test connector=connectors/destination-bigquery-denormalized
|
What
date-time
format in the Json schema is changed totimestamp-micros
.timestamp-micros
, which should not be necessarily.How
Review Order
GcsBigQueryDenormalizedRecordFormatter.java
JsonToAvroSchemaConverter.java
.final
s by the IDE.Checkline