yaooqinn commented on code in PR #44780:
URL: https://github.com/apache/spark/pull/44780#discussion_r1456944531
##########
connector/avro/src/test/scala/org/apache/spark/sql/avro/AvroCodecSuite.scala:
##########
@@ -27,19 +30,34 @@ class AvroCodecSuite extends FileSourceCodecSuite {
override protected def availableCodecs =
AvroCompressionCodec.values().map(_.lowerCaseName()).iterator.to(Seq)
- availableCodecs.foreach { codec =>
+ (availableCodecs ++ availableCodecs.map(_.capitalize)).foreach { codec =>
test(s"SPARK-46746: attach codec name to avro files - codec $codec") {
withTable("avro_t") {
sql(
s"""CREATE TABLE avro_t
| USING $format OPTIONS('compression'='$codec')
| AS SELECT 1 as id
| """.stripMargin)
- spark.table("avro_t")
- .inputFiles.foreach { file =>
- assert(file.endsWith(s"$codec.avro".stripPrefix("uncompressed")))
+ spark
+ .table("avro_t")
+ .inputFiles.foreach { f =>
+
assert(f.endsWith(s"$codec.avro".toLowerCase(Locale.ROOT).stripPrefix("uncompressed")))
}
}
}
}
+
+ test("SPARK-46754: invalid compression codec name in avro table definition")
{
+ checkError(
+ exception = intercept[SparkIllegalArgumentException](
+ sql(
+ s"""CREATE TABLE avro_t
+ | USING $format OPTIONS('compression'='unsupported')
Review Comment:
I have removed any extra spaces and blank lines from both the origin and
this one. Thank you for pointing this out
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]