Skip to content

Commit 8be2838

Browse files
authored
Add scala_2.11 and scala_2.12 support (#85)
1 parent 7eff396 commit 8be2838

File tree

44 files changed

+125
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+125
-20
lines changed

defaultEnvironment.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ subprojects {
1313
project.ext.setProperty('trino-version', '352')
1414
project.ext.setProperty('airlift-slice-version', '0.39')
1515
project.ext.setProperty('spark-group', 'org.apache.spark')
16-
project.ext.setProperty('spark-version', '2.3.0')
16+
project.ext.setProperty('spark2-version', '2.3.0')
17+
project.ext.setProperty('spark3-version', '3.1.1')
1718
}

settings.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ def modules = [
1212
'transportable-udfs-compile-utils',
1313
'transportable-udfs-hive',
1414
'transportable-udfs-plugin',
15-
'transportable-udfs-spark',
15+
'transportable-udfs-spark_2.11',
16+
'transportable-udfs-spark_2.12',
1617
'transportable-udfs-trino',
1718
'transportable-udfs-test:transportable-udfs-test-api',
1819
'transportable-udfs-test:transportable-udfs-test-generic',
1920
'transportable-udfs-test:transportable-udfs-test-hive',
20-
'transportable-udfs-test:transportable-udfs-test-spark',
21+
'transportable-udfs-test:transportable-udfs-test-spark_2.11',
22+
'transportable-udfs-test:transportable-udfs-test-spark_2.12',
2123
'transportable-udfs-test:transportable-udfs-test-spi',
2224
'transportable-udfs-test:transportable-udfs-test-trino',
2325
'transportable-udfs-type-system',

transportable-udfs-examples/transportable-udfs-example-udfs/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ dependencies {
1515

1616
// If the license plugin is applied, disable license checks for the autogenerated source sets
1717
plugins.withId('com.github.hierynomus.license') {
18-
licenseHive.enabled = false
19-
licenseTrino.enabled = false
20-
licenseSpark.enabled = false
18+
tasks.getByName('licenseTrino').enabled = false
19+
tasks.getByName('licenseHive').enabled = false
20+
tasks.getByName('licenseSpark_2.11').enabled = false
21+
tasks.getByName('licenseSpark_2.12').enabled = false
2122
}
2223

2324
// TODO: Add a debugPlatform flag to allow debugging specific test methods in IntelliJ

transportable-udfs-plugin/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def writeVersionInfo = { file ->
2020
entry(key: "transport-version", value: version)
2121
entry(key: "hive-version", value: '1.2.2')
2222
entry(key: "trino-version", value: '352')
23-
entry(key: "spark-version", value: '2.3.0')
23+
entry(key: "spark_2.11-version", value: '2.3.0')
24+
entry(key: "spark_2.12-version", value: '3.1.1')
2425
entry(key: "scala-version", value: '2.11.8')
2526
}
2627
}

transportable-udfs-plugin/src/main/java/com/linkedin/transport/plugin/Defaults.java

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ private static final String getVersion(final String platform) {
4747
return DEFAULT_VERSIONS.getProperty(platform + "-version");
4848
}
4949
private static final String HIVE = "hive";
50-
private static final String SPARK = "spark";
50+
private static final String SPARK_2_11 = "spark_2.11";
51+
private static final String SPARK_2_12 = "spark_2.12";
5152
private static final String TRINO = "trino";
5253

5354
private static final String TRANSPORT_VERSION = getVersion("transport");
5455
private static final String SCALA_VERSION = getVersion("scala");
5556
private static final String HIVE_VERSION = getVersion(HIVE);
56-
private static final String SPARK_VERSION = getVersion(SPARK);
57+
private static final String SPARK_2_11_VERSION = getVersion(SPARK_2_11);
58+
private static final String SPARK_2_12_VERSION = getVersion(SPARK_2_12);
5759
private static final String TRINO_VERSION = getVersion(TRINO);
5860

5961
static final List<DependencyConfiguration> MAIN_SOURCE_SET_DEPENDENCY_CONFIGURATIONS = ImmutableList.of(
@@ -97,16 +99,31 @@ private static final String getVersion(final String platform) {
9799
DependencyConfiguration.builder(RUNTIME_ONLY, "com.linkedin.transport:transportable-udfs-test-hive", TRANSPORT_VERSION).build()
98100
),
99101
ImmutableList.of(new ShadedJarPackaging(ImmutableList.of("org.apache.hadoop", "org.apache.hive"), null))),
100-
new Platform(SPARK,
102+
new Platform(SPARK_2_11,
101103
Language.SCALA,
102104
SparkWrapperGenerator.class,
103105
JavaLanguageVersion.of(8),
104106
ImmutableList.of(
105-
DependencyConfiguration.builder(IMPLEMENTATION, "com.linkedin.transport:transportable-udfs-spark", TRANSPORT_VERSION).build(),
106-
DependencyConfiguration.builder(COMPILE_ONLY, "org.apache.spark:spark-sql_2.11", SPARK_VERSION).build()
107+
DependencyConfiguration.builder(IMPLEMENTATION, "com.linkedin.transport:transportable-udfs-spark_2.11", TRANSPORT_VERSION).build(),
108+
DependencyConfiguration.builder(COMPILE_ONLY, "org.apache.spark:spark-sql_2.11", SPARK_2_11_VERSION).build()
107109
),
108110
ImmutableList.of(
109-
DependencyConfiguration.builder(RUNTIME_ONLY, "com.linkedin.transport:transportable-udfs-test-spark", TRANSPORT_VERSION).build()
111+
DependencyConfiguration.builder(RUNTIME_ONLY, "com.linkedin.transport:transportable-udfs-test-spark_2.11", TRANSPORT_VERSION).build()
112+
),
113+
ImmutableList.of(new ShadedJarPackaging(
114+
ImmutableList.of("org.apache.hadoop", "org.apache.spark"),
115+
ImmutableList.of("com.linkedin.transport.spark.**")))
116+
),
117+
new Platform(SPARK_2_12,
118+
Language.SCALA,
119+
SparkWrapperGenerator.class,
120+
JavaLanguageVersion.of(8),
121+
ImmutableList.of(
122+
DependencyConfiguration.builder(IMPLEMENTATION, "com.linkedin.transport:transportable-udfs-spark_2.12", TRANSPORT_VERSION).build(),
123+
DependencyConfiguration.builder(COMPILE_ONLY, "org.apache.spark:spark-sql_2.12", SPARK_2_12_VERSION).build()
124+
),
125+
ImmutableList.of(
126+
DependencyConfiguration.builder(RUNTIME_ONLY, "com.linkedin.transport:transportable-udfs-test-spark_2.12", TRANSPORT_VERSION).build()
110127
),
111128
ImmutableList.of(new ShadedJarPackaging(
112129
ImmutableList.of("org.apache.hadoop", "org.apache.spark"),

transportable-udfs-spark/build.gradle renamed to transportable-udfs-spark_2.11/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ dependencies {
66
compile project(':transportable-udfs-utils')
77
// For spark-core and spark-sql dependencies, we exclude transitive dependency on 'jackson-module-paranamer',
88
// since this is required for the LinkedIn version of spark-core and spark-sql.
9-
compileOnly(group: project.ext.'spark-group', name: 'spark-core_2.11', version: project.ext.'spark-version') {
9+
compileOnly(group: project.ext.'spark-group', name: 'spark-core_2.11', version: project.ext.'spark2-version') {
1010
exclude module: 'jackson-module-paranamer'
1111
}
12-
compileOnly(group: project.ext.'spark-group', name: 'spark-sql_2.11', version: project.ext.'spark-version') {
12+
compileOnly(group: project.ext.'spark-group', name: 'spark-sql_2.11', version: project.ext.'spark2-version') {
1313
exclude module: 'jackson-module-paranamer'
1414
}
1515
compileOnly('com.fasterxml.jackson.module:jackson-module-paranamer:2.6.7')
16-
testCompile(group: project.ext.'spark-group', name: 'spark-core_2.11', version: project.ext.'spark-version') {
16+
testCompile(group: project.ext.'spark-group', name: 'spark-core_2.11', version: project.ext.'spark2-version') {
1717
exclude module: 'jackson-module-paranamer'
1818
}
19-
testCompile(group: project.ext.'spark-group', name: 'spark-sql_2.11', version: project.ext.'spark-version') {
19+
testCompile(group: project.ext.'spark-group', name: 'spark-sql_2.11', version: project.ext.'spark2-version') {
2020
exclude module: 'jackson-module-paranamer'
2121
}
2222
testCompile('com.fasterxml.jackson.module:jackson-module-paranamer:2.6.7')

0 commit comments

Comments
 (0)