-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark: refactor Spark modules to support multiple versions #3237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e2f3e01
5dd4389
09bdf3f
7039ff7
b829a20
d31847d
065fea2
b6b24e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,10 +32,6 @@ include 'orc' | |
| include 'arrow' | ||
| include 'parquet' | ||
| include 'bundled-guava' | ||
| include 'spark' | ||
| include 'spark3' | ||
| include 'spark3-extensions' | ||
| include 'spark3-runtime' | ||
| include 'pig' | ||
| include 'hive-metastore' | ||
| include 'nessie' | ||
|
|
@@ -54,22 +50,38 @@ project(':orc').name = 'iceberg-orc' | |
| project(':arrow').name = 'iceberg-arrow' | ||
| project(':parquet').name = 'iceberg-parquet' | ||
| project(':bundled-guava').name = 'iceberg-bundled-guava' | ||
| project(':spark').name = 'iceberg-spark' | ||
| project(':spark3').name = 'iceberg-spark3' | ||
| project(':spark3-extensions').name = 'iceberg-spark3-extensions' | ||
| project(':spark3-runtime').name = 'iceberg-spark3-runtime' | ||
| project(':pig').name = 'iceberg-pig' | ||
| project(':hive-metastore').name = 'iceberg-hive-metastore' | ||
| project(':nessie').name = 'iceberg-nessie' | ||
|
|
||
| // spark | ||
| include 'spark-common' | ||
| include 'spark' | ||
| include 'spark-extensions' | ||
| include 'spark-runtime' | ||
|
|
||
| var SparkSrcVersion = System.getProperty("sparkSrc") != null ? System.getProperty("sparkSrc") : '3_0' | ||
|
|
||
| if (SparkSrcVersion == '2_4' && JavaVersion.current() != JavaVersion.VERSION_1_8) { | ||
| throw new Exception("Expected java8 to build Spark 2.4, but got ${SparkSrcVersion}") | ||
| } | ||
|
|
||
| project(':spark-common').name = 'iceberg-spark-common' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed this to common to make
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The common package should contain only code compilable across all versions. Then for every backwards incompatible version, we create a new source version directory, which will build against Spark versions until it becomes incompatible. So for example here, source version 3_0 is built against both 3.0.3 and 3.1.1. When we introduce 3_2, it will build against 3.2.x, and maybe even 3.3.x. |
||
| project(':spark').projectDir = file("spark/${SparkSrcVersion}/core") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technically we want the name to be something like |
||
| project(':spark').name = 'iceberg-spark' | ||
|
|
||
| if (SparkSrcVersion != '2_4') { | ||
| project(':spark-extensions').projectDir = file("spark/${SparkSrcVersion}/extensions") | ||
| project(':spark-extensions').name = 'iceberg-spark-extensions' | ||
| } | ||
|
|
||
| project(':spark-runtime').projectDir = file("spark/${SparkSrcVersion}/runtime") | ||
| project(':spark-runtime').name = 'iceberg-spark-runtime' | ||
|
|
||
| if (JavaVersion.current() == JavaVersion.VERSION_1_8) { | ||
| include 'spark2' | ||
| include 'spark-runtime' | ||
| include 'hive3' | ||
| include 'hive3-orc-bundle' | ||
|
|
||
| project(':spark2').name = 'iceberg-spark2' | ||
| project(':spark-runtime').name = 'iceberg-spark-runtime' | ||
| project(':hive3').name = 'iceberg-hive3' | ||
| project(':hive3-orc-bundle').name = 'iceberg-hive3-orc-bundle' | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically we don't have to expose this to users, and we can have a map of all build versions supported by a source version. But I am not sure yet which way is better.