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

Sanitize Avro Names [Project id] using readAvros #200

Conversation

ryanvanhuuksloot
Copy link

We need to sanitize the project id from the readAvros function. Otherwise you get

Exception in thread "main" org.apache.avro.SchemaParseException: Namespace part "sdp-stg-shop-ml" is invalid: Illegal character in: sdp-stg-shop-ml
	at org.apache.avro.ParseContext.validateName(ParseContext.java:242)
	at org.apache.avro.ParseContext.requireValidFullName(ParseContext.java:233)
	at org.apache.avro.ParseContext.put(ParseContext.java:214)
	at org.apache.avro.Schema.parseRecord(Schema.java:1865)
	at org.apache.avro.Schema.parse(Schema.java:1835)
	at org.apache.avro.Schema$Parser.parse(Schema.java:1538)
	at org.apache.avro.Schema$Parser.parse(Schema.java:1515)
	at com.google.cloud.flink.bigquery.source.reader.deserializer.AvroDeserializationSchema.getProducedType(AvroDeserializationSchema.java:47)
	at com.google.cloud.flink.bigquery.source.BigQuerySource.getProducedType(BigQuerySource.java:139)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getTypeInfo(StreamExecutionEnvironment.java:2921)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.fromSource(StreamExecutionEnvironment.java:2282)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.fromSource(StreamExecutionEnvironment.java:2253)
	at com.shopify.disco.bigquery.BigQueryJob.main(BigQueryJob.java:41)

Even though the project id is valid

Important to note that there are other interfaces that likely also need this change

Copy link

google-cla bot commented Jan 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jayehwhyehentee jayehwhyehentee self-requested a review January 25, 2025 05:31
@jayehwhyehentee
Copy link
Collaborator

/gcbrun

@jayehwhyehentee
Copy link
Collaborator

Accepting source name sanitization changes in #202.

Cannot add connector's 1.17 module in root pom since intention is to limit the build using profiles. Right now it's not intuitive since there is only one profile (for 1.17). However, once higher versions (1.20+) are supported, they will become separate profiles.

@ryanvanhuuksloot ryanvanhuuksloot deleted the rvh.sanitize-avro-project-read-avros branch January 26, 2025 19:04
@ryanvanhuuksloot
Copy link
Author

Yup, no problem. Didn't see the modules. Was building locally and that was the convenient way to build the module. I'll stick with profiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants