Skip to content

Commit 9642a4a

Browse files
Add support for Spark 4.0
1 parent 11c2849 commit 9642a4a

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.github/workflows/test-and-verify.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
spark: [ 3.2, 3.3, 3.4, 3.5 ]
15+
spark: [ 3.2, 3.3, 3.4, 3.5, 4.0 ]
1616
scala: [ 2.12, 2.13 ]
1717

1818
name: Spark ${{ matrix.spark }}, Scala ${{ matrix.scala }}
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
2224
- name: Set up JDK 1.8
23-
uses: actions/setup-java@v1
2425
with:
25-
java-version: 1.8
26+
distribution: 'adopt'
27+
java-version: 8
2628
- name: Run tests
2729
run: mvn clean verify -Plicense-check,spark-${{ matrix.spark }},scala-${{ matrix.scala }}

pom.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,27 @@
389389
<profile>
390390
<id>spark-3.4</id>
391391
<properties>
392-
<spark.version>3.4.2</spark.version>
392+
<spark.version>3.4.4</spark.version>
393393
<avro.version>1.11.1</avro.version>
394394
<jackson.core.version>2.14.2</jackson.core.version>
395395
</properties>
396396
</profile>
397397
<profile>
398398
<id>spark-3.5</id>
399399
<properties>
400-
<spark.version>3.5.0</spark.version>
400+
<spark.version>3.5.6</spark.version>
401401
<avro.version>1.11.2</avro.version>
402402
<jackson.core.version>2.15.2</jackson.core.version>
403403
</properties>
404404
</profile>
405+
<profile>
406+
<id>spark-4.0</id>
407+
<properties>
408+
<spark.version>4.0.0</spark.version>
409+
<avro.version>1.12.0</avro.version>
410+
<jackson.core.version>2.18.2</jackson.core.version>
411+
</properties>
412+
</profile>
405413
<profile>
406414
<id>uber</id>
407415
<build>

src/main/scala/org/apache/spark/sql/avro/AbrisAvroDeserializer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ class AbrisAvroDeserializer(rootAvroType: Schema, rootCatalystType: DataType) {
4848
currCtor.newInstance(rootAvroType, rootCatalystType, "LEGACY")
4949
case currCtor if currCtor.getParameterTypes sameElements
5050
Array(schemaClz, dataTypeClz, stringClz, booleanClz) =>
51-
// Spark 3.5.1 - 3.5.2
51+
// Spark 3.5.1 - 3.5.6
5252
currCtor.newInstance(rootAvroType, rootCatalystType, "LEGACY", false: java.lang.Boolean)
5353
case currCtor if currCtor.getParameterTypes.toSeq sameElements
5454
Array(schemaClz, dataTypeClz, stringClz, booleanClz, stringClz) =>
55-
// Spark 4.0.0-SNAPSHOT+
56-
currCtor.newInstance(rootAvroType, rootCatalystType, "LEGACY", false: java.lang.Boolean, "")
55+
// Spark 4.0.0
56+
currCtor.newInstance(rootAvroType, rootCatalystType, "LEGACY", false: java.lang.Boolean, "") // ,-1
5757
} match {
5858
case Some(value: AvroDeserializer) =>
5959
value

0 commit comments

Comments
 (0)