Skip to content

Commit 5de80b7

Browse files
committed
[SPARK-50886][BUILD][3.5] Upgrade Avro to 1.11.4
### What changes were proposed in this pull request? This PR aims to upgrade Avro to 1.11.4. ### Why are the changes needed? To bring the latest bug fixes like the following. - https://github.com/apache/avro/releases/tag/release-1.11.3 - apache/avro#2432 - apache/avro#2318 - apache/avro#1720 - https://github.com/apache/avro/releases/tag/release-1.11.4 - apache/avro#2980 ### Does this PR introduce _any_ user-facing change? Yes, this is a dependency change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#49563 from dongjoon-hyun/SPARK-50886. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 51fb84a commit 5de80b7

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroOptions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ private[sql] class AvroOptions(
8181

8282
/**
8383
* Top level record name in write result, which is required in Avro spec.
84-
* See https://avro.apache.org/docs/1.11.2/specification/#schema-record .
84+
* See https://avro.apache.org/docs/1.11.4/specification/#schema-record .
8585
* Default value is "topLevelRecord"
8686
*/
8787
val recordName: String = parameters.getOrElse(RECORD_NAME, "topLevelRecord")
8888

8989
/**
9090
* Record namespace in write result. Default value is "".
91-
* See Avro spec for details: https://avro.apache.org/docs/1.11.2/specification/#schema-record .
91+
* See Avro spec for details: https://avro.apache.org/docs/1.11.4/specification/#schema-record .
9292
*/
9393
val recordNamespace: String = parameters.getOrElse(RECORD_NAMESPACE, "")
9494

dev/deps/spark-deps-hadoop-3-hive-2.3

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ arrow-memory-core/12.0.1//arrow-memory-core-12.0.1.jar
2121
arrow-memory-netty/12.0.1//arrow-memory-netty-12.0.1.jar
2222
arrow-vector/12.0.1//arrow-vector-12.0.1.jar
2323
audience-annotations/0.5.0//audience-annotations-0.5.0.jar
24-
avro-ipc/1.11.2//avro-ipc-1.11.2.jar
25-
avro-mapred/1.11.2//avro-mapred-1.11.2.jar
26-
avro/1.11.2//avro-1.11.2.jar
24+
avro-ipc/1.11.4//avro-ipc-1.11.4.jar
25+
avro-mapred/1.11.4//avro-mapred-1.11.4.jar
26+
avro/1.11.4//avro-1.11.4.jar
2727
aws-java-sdk-bundle/1.12.262//aws-java-sdk-bundle-1.12.262.jar
2828
azure-data-lake-store-sdk/2.3.9//azure-data-lake-store-sdk-2.3.9.jar
2929
azure-keyvault-core/1.0.0//azure-keyvault-core-1.0.0.jar

docs/sql-data-sources-avro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ applications. Read the [Advanced Dependency Management](https://spark.apache
417417
Submission Guide for more details.
418418

419419
## Supported types for Avro -> Spark SQL conversion
420-
Currently Spark supports reading all [primitive types](https://avro.apache.org/docs/1.11.2/specification/#primitive-types) and [complex types](https://avro.apache.org/docs/1.11.2/specification/#complex-types) under records of Avro.
420+
Currently Spark supports reading all [primitive types](https://avro.apache.org/docs/1.11.4/specification/#primitive-types) and [complex types](https://avro.apache.org/docs/1.11.4/specification/#complex-types) under records of Avro.
421421
<table>
422422
<thead><tr><th><b>Avro type</b></th><th><b>Spark SQL type</b></th></tr></thead>
423423
<tr>
@@ -481,7 +481,7 @@ In addition to the types listed above, it supports reading `union` types. The fo
481481
3. `union(something, null)`, where something is any supported Avro type. This will be mapped to the same Spark SQL type as that of something, with nullable set to true.
482482
All other union types are considered complex. They will be mapped to StructType where field names are member0, member1, etc., in accordance with members of the union. This is consistent with the behavior when converting between Avro and Parquet.
483483

484-
It also supports reading the following Avro [logical types](https://avro.apache.org/docs/1.11.2/specification/#logical-types):
484+
It also supports reading the following Avro [logical types](https://avro.apache.org/docs/1.11.4/specification/#logical-types):
485485

486486
<table>
487487
<thead><tr><th><b>Avro logical type</b></th><th><b>Avro type</b></th><th><b>Spark SQL type</b></th></tr></thead>

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
-->
159159
<codahale.metrics.version>4.2.19</codahale.metrics.version>
160160
<!-- Should be consistent with SparkBuild.scala and docs -->
161-
<avro.version>1.11.2</avro.version>
161+
<avro.version>1.11.4</avro.version>
162162
<aws.kinesis.client.version>1.12.0</aws.kinesis.client.version>
163163
<!-- Should be consistent with Kinesis client dependency -->
164164
<aws.java.sdk.version>1.11.655</aws.java.sdk.version>
@@ -1485,6 +1485,10 @@
14851485
<artifactId>avro</artifactId>
14861486
<version>${avro.version}</version>
14871487
<exclusions>
1488+
<exclusion>
1489+
<groupId>org.apache.commons</groupId>
1490+
<artifactId>commons-compress</artifactId>
1491+
</exclusion>
14881492
<exclusion>
14891493
<groupId>commons-io</groupId>
14901494
<artifactId>commons-io</artifactId>

project/SparkBuild.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,8 @@ object DependencyOverrides {
11031103
dependencyOverrides += "com.google.guava" % "guava" % guavaVersion,
11041104
dependencyOverrides += "xerces" % "xercesImpl" % "2.12.2",
11051105
dependencyOverrides += "jline" % "jline" % "2.14.6",
1106-
dependencyOverrides += "org.apache.avro" % "avro" % "1.11.2")
1106+
dependencyOverrides += "org.apache.avro" % "avro" % "1.11.4",
1107+
dependencyOverrides += "org.apache.commons" % "commons-compress" % "1.23.0")
11071108
}
11081109

11091110
/**

sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ class HiveClientSuite(version: String, allVersions: Seq[String])
908908
test("Decimal support of Avro Hive serde") {
909909
val tableName = "tab1"
910910
// TODO: add the other logical types. For details, see the link:
911-
// https://avro.apache.org/docs/1.11.2/specification/#logical-types
911+
// https://avro.apache.org/docs/1.11.4/specification/#logical-types
912912
val avroSchema =
913913
"""{
914914
| "name": "test_record",

0 commit comments

Comments
 (0)