Skip to content
Snippets Groups Projects
Commit 78887f94 authored by Bertrand Bossy's avatar Bertrand Bossy Committed by Patrick Wendell
Browse files

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 <bertrandbossy@gmail.com>

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

(cherry picked from commit c243b21a)
Signed-off-by: default avatarPatrick Wendell <pwendell@gmail.com>
parent 70f93d5a
No related branches found
No related tags found
No related merge requests found
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
<chill.version>0.3.6</chill.version> <chill.version>0.3.6</chill.version>
<codahale.metrics.version>3.0.0</codahale.metrics.version> <codahale.metrics.version>3.0.0</codahale.metrics.version>
<avro.version>1.7.6</avro.version> <avro.version>1.7.6</avro.version>
<avro.mapred.classifier></avro.mapred.classifier>
<jets3t.version>0.7.1</jets3t.version> <jets3t.version>0.7.1</jets3t.version>
<aws.java.sdk.version>1.8.3</aws.java.sdk.version> <aws.java.sdk.version>1.8.3</aws.java.sdk.version>
<aws.kinesis.client.version>1.1.0</aws.kinesis.client.version> <aws.kinesis.client.version>1.1.0</aws.kinesis.client.version>
...@@ -607,6 +608,7 @@ ...@@ -607,6 +608,7 @@
<groupId>org.apache.avro</groupId> <groupId>org.apache.avro</groupId>
<artifactId>avro-mapred</artifactId> <artifactId>avro-mapred</artifactId>
<version>${avro.version}</version> <version>${avro.version}</version>
<classifier>${avro.mapred.classifier}</classifier>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
...@@ -1079,6 +1081,7 @@ ...@@ -1079,6 +1081,7 @@
<properties> <properties>
<hadoop.version>2.2.0</hadoop.version> <hadoop.version>2.2.0</hadoop.version>
<protobuf.version>2.5.0</protobuf.version> <protobuf.version>2.5.0</protobuf.version>
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
</properties> </properties>
</profile> </profile>
...@@ -1088,6 +1091,7 @@ ...@@ -1088,6 +1091,7 @@
<hadoop.version>2.3.0</hadoop.version> <hadoop.version>2.3.0</hadoop.version>
<protobuf.version>2.5.0</protobuf.version> <protobuf.version>2.5.0</protobuf.version>
<jets3t.version>0.9.0</jets3t.version> <jets3t.version>0.9.0</jets3t.version>
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
</properties> </properties>
</profile> </profile>
...@@ -1097,6 +1101,7 @@ ...@@ -1097,6 +1101,7 @@
<hadoop.version>2.4.0</hadoop.version> <hadoop.version>2.4.0</hadoop.version>
<protobuf.version>2.5.0</protobuf.version> <protobuf.version>2.5.0</protobuf.version>
<jets3t.version>0.9.0</jets3t.version> <jets3t.version>0.9.0</jets3t.version>
<avro.mapred.classifier>hadoop2</avro.mapred.classifier>
</properties> </properties>
</profile> </profile>
......
...@@ -94,6 +94,15 @@ ...@@ -94,6 +94,15 @@
<dependency> <dependency>
<groupId>org.apache.avro</groupId> <groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId> <artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>
<!-- use the build matching the hadoop api of avro-mapred (i.e. no classifier for hadoop 1 API,
hadoop2 classifier for hadoop 2 API. avro-mapred is a dependency of org.spark-project.hive:hive-serde -->
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-mapred</artifactId>
<version>${avro.version}</version>
<classifier>${avro.mapred.classifier}</classifier>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.scalatest</groupId> <groupId>org.scalatest</groupId>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment