[GitHub] spark pull request #21829: [SPARK-24876][SQL] Avro: simplify schema serializ...
Github user asfgit closed the pull request at: https://github.com/apache/spark/pull/21829 --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #21829: [SPARK-24876][SQL] Avro: simplify schema serializ...
Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/21829#discussion_r204100563 --- Diff: external/avro/src/main/scala/org/apache/spark/sql/avro/AvroOutputWriterFactory.scala --- @@ -17,21 +17,24 @@ package org.apache.spark.sql.avro +import org.apache.avro.Schema import org.apache.hadoop.mapreduce.TaskAttemptContext import org.apache.spark.sql.execution.datasources.{OutputWriter, OutputWriterFactory} import org.apache.spark.sql.types.StructType private[avro] class AvroOutputWriterFactory( schema: StructType, -avroSchema: SerializableSchema) extends OutputWriterFactory { +avroJsonSchema: String) extends OutputWriterFactory { + + private lazy val avroSchema = new Schema.Parser().parse(avroJsonSchema) --- End diff -- the naming is confusing. We have `schema`, `avroJsonSchema` and `avroSchema`. Also add comments about these variables. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #21829: [SPARK-24876][SQL] Avro: simplify schema serializ...
GitHub user gengliangwang opened a pull request: https://github.com/apache/spark/pull/21829 [SPARK-24876][SQL] Avro: simplify schema serialization ## What changes were proposed in this pull request? Previously in the refactoring of Avro Serializer and Deserializer, a new class SerializableSchema is created for serializing the Avro schema: https://github.com/apache/spark/pull/21762/files#diff-01fea32e6ec6bcf6f34d06282e08705aR37 On second thought, we can use `toString` method for serialization. After that, parse the JSON format schema on executor. This makes the code much simpler. ## How was this patch tested? Unit test You can merge this pull request into a Git repository by running: $ git pull https://github.com/gengliangwang/spark removeSerializableSchema Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/21829.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #21829 commit f3765031d5f0126780e7c823301392063dea1d2f Author: Gengliang Wang Date: 2018-07-20T13:06:39Z remove SerializableSchema --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org