[
https://issues.apache.org/jira/browse/BEAM-7829?focusedWorklogId=288946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-288946
]
ASF GitHub Bot logged work on BEAM-7829:
----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Aug/19 13:40
Start Date: 05/Aug/19 13:40
Worklog Time Spent: 10m
Work Description: RyanSkraba commented on pull request #9247: [BEAM-7829]
Add schema names when converting with AvroUtils.toAvroSchema
URL: https://github.com/apache/beam/pull/9247
There's a subtle problem with unnamed records in Avro and Java -- they can
be used to correctly serialize/deserialize binary data as long as nobody counts
on serializing/deserializing the actual Avro schema as a JSON string.
This *can* work if both reader and writer can infer the schema from another
source (like the Beam Schema), but is certain to break when passing the schema
or record to a transform that expects the schema to meet the Avro specification.
More discussion at: https://issues.apache.org/jira/browse/AVRO-2492
This change ensures that no anonymous Avro records will be created as part
of translating a Beam schema.
*N.B.* Credit goes to @iemejia for this implementation, I just cleaned up
the tests.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] [**Choose
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and
mention them in a comment (`R: @username`).
- [X] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
Java | [](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/)
Pre-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
--- |Java | Python | Go | Website
--- | --- | --- | --- | ---
Non-portable | [](https://builds.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/)
Portable | --- | [](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/)
| --- | ---
See
[.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md)
for trigger phrase, status and link of all Jenkins jobs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 288946)
Time Spent: 10m
Remaining Estimate: 0h
> AvroUtils.toAvroSchema should put a Schema name to pass Avro Schema validation
> ------------------------------------------------------------------------------
>
> Key: BEAM-7829
> URL: https://issues.apache.org/jira/browse/BEAM-7829
> Project: Beam
> Issue Type: Test
> Components: io-java-avro, sdk-java-core
> Reporter: Ismaël Mejía
> Assignee: Ryan Skraba
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> While trying to use an Avro PCollection with the SQL transform I notice you
> could not do correctly a bijective transform: PCollection<GenericRecord> ->
> SQL -> PCollection<Row> -> ParDo -> PCollection<GenericRecord> I noticed that
> some of the Avro metadata gets lost in particular the name of the Avro
> Schema. This is important because Avro validates that the schema has a name
> and if it does not it breaks with a ParseException.
> {quote}
> org.apache.avro.SchemaParseException: Illegal character in: EXPR$1
> at org.apache.avro.Schema.validateName (Schema.java:1151)
> at org.apache.avro.Schema.access$200 (Schema.java:81)
> at org.apache.avro.Schema$Field.<init> (Schema.java:403)
> at org.apache.avro.Schema$Field.<init> (Schema.java:423)
> at org.apache.avro.Schema$Field.<init> (Schema.java:415){quote}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
