From 2d75b99b970bdab55646151328e20974bdfae27f Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 8 Sep 2021 22:17:35 -0700 Subject: [PATCH] [SPARK-36670][SQL][TEST][FOLLOWUP] Add AvroCodecSuite ### What changes were proposed in this pull request? This patch proposes to add also `AvroCodecSuite` as a follow up for SPARK-36670. ### Why are the changes needed? Improve test coverage. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added test. Closes #33939 from viirya/SPARK-36670-avro. Authored-by: Liang-Chi Hsieh Signed-off-by: Liang-Chi Hsieh (cherry picked from commit c95d3fe6c98ef1a4b1b68a5243ad7c87a1edcbcc) Signed-off-by: Liang-Chi Hsieh --- .../spark/sql/avro/AvroCodecSuite.scala | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 external/avro/src/test/scala/org/apache/spark/sql/avro/AvroCodecSuite.scala diff --git a/external/avro/src/test/scala/org/apache/spark/sql/avro/AvroCodecSuite.scala b/external/avro/src/test/scala/org/apache/spark/sql/avro/AvroCodecSuite.scala new file mode 100644 index 0000000000..9a4bcc623b --- /dev/null +++ b/external/avro/src/test/scala/org/apache/spark/sql/avro/AvroCodecSuite.scala @@ -0,0 +1,29 @@ +/* + * 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.avro + +import org.apache.spark.sql.execution.datasources.FileSourceCodecSuite +import org.apache.spark.sql.internal.SQLConf + +class AvroCodecSuite extends FileSourceCodecSuite { + + override def format: String = "avro" + override val codecConfigName: String = SQLConf.AVRO_COMPRESSION_CODEC.key + override protected def availableCodecs = Seq("uncompressed", "deflate", "snappy", + "bzip2", "xz", "zstandard") +}