This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 26e9849 [SPARK-27195][SQL][TEST] Add AvroReadSchemaSuite
26e9849 is described below
commit 26e9849cb49e4f83656d482d0a979a4cb14cbefc
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Mar 18 20:10:30 2019 -0700
[SPARK-27195][SQL][TEST] Add AvroReadSchemaSuite
## What changes were proposed in this pull request?
The reader schema is said to be evolved (or projected) when it changed
after the data is written by writers. Apache Spark file-based data sources have
a test coverage for that,
[ReadSchemaSuite.scala](https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaSuite.scala).
This PR aims to add `AvroReadSchemaSuite` to ensure the minimal consistency
among file-based data sources and prevent a future regression in Avro data
source.
## How was this patch tested?
Pass the Jenkins with the newly added test suite.
Closes #24135 from dongjoon-hyun/SPARK-27195.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../datasources/AvroReadSchemaSuite.scala | 27 ++++++++++++++++++++++
.../execution/datasources/ReadSchemaSuite.scala | 2 ++
.../sql/execution/datasources/ReadSchemaTest.scala | 6 ++++-
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git
a/external/avro/src/test/scala/org/apache/spark/sql/execution/datasources/AvroReadSchemaSuite.scala
b/external/avro/src/test/scala/org/apache/spark/sql/execution/datasources/AvroReadSchemaSuite.scala
new file mode 100644
index 0000000..a480bb9
--- /dev/null
+++
b/external/avro/src/test/scala/org/apache/spark/sql/execution/datasources/AvroReadSchemaSuite.scala
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.datasources
+
+class AvroReadSchemaSuite
+ extends ReadSchemaSuite
+ with AddColumnIntoTheMiddleTest
+ with HideColumnInTheMiddleTest
+ with ChangePositionTest {
+
+ override val format: String = "avro"
+}
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaSuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaSuite.scala
index de234c1..802fda8 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaSuite.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaSuite.scala
@@ -36,6 +36,8 @@ import org.apache.spark.sql.internal.SQLConf
* -> ParquetReadSchemaSuite
* -> VectorizedParquetReadSchemaSuite
* -> MergedParquetReadSchemaSuite
+ *
+ * -> AvroReadSchemaSuite
*/
/**
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala
index 17d9d43..d428095 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala
@@ -46,6 +46,7 @@ import org.apache.spark.sql.test.{SharedSQLContext,
SQLTestUtils}
* | JSON | 1, 2, 3, 4 |
|
* | ORC | 1, 2, 3, 4 | Native vectorized ORC reader has the
widest coverage. |
* | PARQUET | 1, 2, 3 |
|
+ * | AVRO | 1, 2, 3 |
|
*
* This aims to provide an explicit test coverage for reader schema change on
file-based data
* sources. Since a file format has its own coverage, we need a test suite for
each file-based
@@ -55,9 +56,12 @@ import org.apache.spark.sql.test.{SharedSQLContext,
SQLTestUtils}
*
* ReadSchemaTest
* -> AddColumnTest
- * -> HideColumnTest
+ * -> AddColumnIntoTheMiddleTest
+ * -> HideColumnAtTheEndTest
+ * -> HideColumnInTheMiddleTest
* -> ChangePositionTest
* -> BooleanTypeTest
+ * -> ToStringTypeTest
* -> IntegralTypeTest
* -> ToDoubleTypeTest
* -> ToDecimalTypeTest
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]