Skip to content

Commit c243b21

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 #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
1 parent 4e3fbe8 commit c243b21

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
@@ -134,6 +134,7 @@
134134
<chill.version>0.3.6</chill.version>
135135
<codahale.metrics.version>3.0.0</codahale.metrics.version>
136136
<avro.version>1.7.6</avro.version>
137+
<avro.mapred.classifier></avro.mapred.classifier>
137138
<jets3t.version>0.7.1</jets3t.version>
138139
<aws.java.sdk.version>1.8.3</aws.java.sdk.version>
139140
<aws.kinesis.client.version>1.1.0</aws.kinesis.client.version>
@@ -621,6 +622,7 @@
621622
<groupId>org.apache.avro</groupId>
622623
<artifactId>avro-mapred</artifactId>
623624
<version>${avro.version}</version>
625+
<classifier>${avro.mapred.classifier}</classifier>
624626
<exclusions>
625627
<exclusion>
626628
<groupId>io.netty</groupId>
@@ -1108,6 +1110,7 @@
11081110
<properties>
11091111
<hadoop.version>2.2.0</hadoop.version>
11101112
<protobuf.version>2.5.0</protobuf.version>
1113+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
11111114
</properties>
11121115
</profile>
11131116

@@ -1117,6 +1120,7 @@
11171120
<hadoop.version>2.3.0</hadoop.version>
11181121
<protobuf.version>2.5.0</protobuf.version>
11191122
<jets3t.version>0.9.0</jets3t.version>
1123+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
11201124
</properties>
11211125
</profile>
11221126

@@ -1126,6 +1130,7 @@
11261130
<hadoop.version>2.4.0</hadoop.version>
11271131
<protobuf.version>2.5.0</protobuf.version>
11281132
<jets3t.version>0.9.0</jets3t.version>
1133+
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
11291134
</properties>
11301135
</profile>
11311136

sql/hive/pom.xml

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

0 commit comments

Comments
 (0)