Skip to content

Commit 78887f9

Browse files
bbossypwendell
authored andcommitted
SPARK-3039: Allow spark to be built using avro-mapred for hadoop2
SPARK-3039: Adds the maven property "avro.mapred.classifier" to build spark-assembly with avro-mapred with support for the new Hadoop API. Sets this property to hadoop2 for Hadoop 2 profiles. I am not very familiar with maven, nor do I know whether this potentially breaks something in the hive part of spark. There might be a more elegant way of doing this. Author: Bertrand Bossy <[email protected]> Closes apache#1945 from bbossy/SPARK-3039 and squashes the following commits: c32ce59 [Bertrand Bossy] SPARK-3039: Allow spark to be built using avro-mapred for hadoop2 (cherry picked from commit c243b21) Signed-off-by: Patrick Wendell <[email protected]>
1 parent 70f93d5 commit 78887f9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
<chill.version>0.3.6</chill.version>
134134
<codahale.metrics.version>3.0.0</codahale.metrics.version>
135135
<avro.version>1.7.6</avro.version>
136+
<avro.mapred.classifier></avro.mapred.classifier>
136137
<jets3t.version>0.7.1</jets3t.version>
137138
<aws.java.sdk.version>1.8.3</aws.java.sdk.version>
138139
<aws.kinesis.client.version>1.1.0</aws.kinesis.client.version>
@@ -607,6 +608,7 @@
607608
<groupId>org.apache.avro</groupId>
608609
<artifactId>avro-mapred</artifactId>
609610
<version>${avro.version}</version>
611+
<classifier>${avro.mapred.classifier}</classifier>
610612
<exclusions>
611613
<exclusion>
612614
<groupId>io.netty</groupId>
@@ -1079,6 +1081,7 @@
10791081
<properties>
10801082
<hadoop.version>2.2.0</hadoop.version>
10811083
<protobuf.version>2.5.0</protobuf.version>
1084+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
10821085
</properties>
10831086
</profile>
10841087

@@ -1088,6 +1091,7 @@
10881091
<hadoop.version>2.3.0</hadoop.version>
10891092
<protobuf.version>2.5.0</protobuf.version>
10901093
<jets3t.version>0.9.0</jets3t.version>
1094+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
10911095
</properties>
10921096
</profile>
10931097

@@ -1097,6 +1101,7 @@
10971101
<hadoop.version>2.4.0</hadoop.version>
10981102
<protobuf.version>2.5.0</protobuf.version>
10991103
<jets3t.version>0.9.0</jets3t.version>
1104+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
11001105
</properties>
11011106
</profile>
11021107

sql/hive/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@
9494
<dependency>
9595
<groupId>org.apache.avro</groupId>
9696
<artifactId>avro</artifactId>
97+
<version>${avro.version}</version>
98+
</dependency>
99+
<!-- use the build matching the hadoop api of avro-mapred (i.e. no classifier for hadoop 1 API,
100+
hadoop2 classifier for hadoop 2 API. avro-mapred is a dependency of org.spark-project.hive:hive-serde -->
101+
<dependency>
102+
<groupId>org.apache.avro</groupId>
103+
<artifactId>avro-mapred</artifactId>
104+
<version>${avro.version}</version>
105+
<classifier>${avro.mapred.classifier}</classifier>
97106
</dependency>
98107
<dependency>
99108
<groupId>org.scalatest</groupId>

0 commit comments

Comments
 (0)