You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gengliangwang <gi...@git.apache.org> on 2018/07/20 13:32:36 UTC
[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 <ge...@...>
Date: 2018-07-20T13:06:39Z
remove SerializableSchema
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/21829
**[Test build #93355 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/93355/testReport)** for PR 21829 at commit [`bdf2f48`](https://github.com/apache/spark/commit/bdf2f4853426ebb9f86ff132187fda3fa3977f55).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/21829
**[Test build #93355 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/93355/testReport)** for PR 21829 at commit [`bdf2f48`](https://github.com/apache/spark/commit/bdf2f4853426ebb9f86ff132187fda3fa3977f55).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1172/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/21829
**[Test build #93347 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/93347/testReport)** for PR 21829 at commit [`f376503`](https://github.com/apache/spark/commit/f3765031d5f0126780e7c823301392063dea1d2f).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93355/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #21829: [SPARK-24876][SQL] Avro: simplify schema serializ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/21829
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #21829: [SPARK-24876][SQL] Avro: simplify schema serializ...
Posted by gatorsmile <gi...@git.apache.org>.
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-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/21829
LGTM
Thanks! Merged to master
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93347/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1178/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/21829
**[Test build #93347 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/93347/testReport)** for PR 21829 at commit [`f376503`](https://github.com/apache/spark/commit/f3765031d5f0126780e7c823301392063dea1d2f).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #21829: [SPARK-24876][SQL] Avro: simplify schema serialization
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/21829
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org