Skip to content

Commit

Permalink
Use avro name sanitization in source (#202)
Browse files Browse the repository at this point in the history
Change suggested by @ryanvanhuuksloot (Shopify)
  • Loading branch information
jayehwhyehentee authored Jan 26, 2025
1 parent d9c7983 commit 917c2c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ public static BigQuerySource<GenericRecord> readAvros(BigQueryReadOptions readOp
SchemaTransform.toGenericAvroSchema(
String.format(
"%s.%s.%s",
connectOptions.getProjectId(),
connectOptions.getDataset(),
sanitizeAvroSchemaName(
connectOptions.getProjectId()),
sanitizeAvroSchemaName(
connectOptions.getDataset()),
sanitizeAvroSchemaName(
connectOptions.getTable())),
tableSchema.getFields())
Expand Down Expand Up @@ -351,8 +353,10 @@ public static BigQuerySource<GenericRecord> streamAvros(BigQueryReadOptions read
SchemaTransform.toGenericAvroSchema(
String.format(
"%s.%s.%s",
connectOptions.getProjectId(),
connectOptions.getDataset(),
sanitizeAvroSchemaName(
connectOptions.getProjectId()),
sanitizeAvroSchemaName(
connectOptions.getDataset()),
sanitizeAvroSchemaName(
connectOptions.getTable())),
tableSchema.getFields())
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ under the License.
<version>3.24.2</version>
<scope>test</scope>
</dependency>

<!-- Unavoidable Flink Dependencies -->
<!-- The Idea is to have one same flink
version that governs annotations and flink-core version -->
Expand All @@ -306,7 +306,7 @@ under the License.
<artifactId>flink-annotations</artifactId>
<version>${flink.version}</version>
</dependency>
<!-- Dependency required for SerializableSupplier,
<!-- Dependency required for SerializableSupplier,
Preconditions, BiConsumerWithException,
FunctionWithException used across the Project. -->
<dependency>
Expand Down

0 comments on commit 917c2c0

Please sign in to comment.