-
Notifications
You must be signed in to change notification settings - Fork 78
Spark 4 support #452
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
Spark 4 support #452
Changes from 7 commits
db42f5f
ceb5e88
0975865
552287d
ce8c148
6ec7406
6d449b3
5d8ccbe
fc343e8
a5d3234
15ea56f
cb80ad3
48d80e0
7aa037d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,21 @@ jobs: | |
| max-parallel: 1 | ||
| fail-fast: false | ||
| matrix: | ||
| spark: [ 3.3, 3.4, 3.5 ] | ||
| scala: [ 2.12, 2.13 ] | ||
| spark: [ '3.3', '3.4', '3.5', '4.0' ] | ||
| scala: [ '2.12', '2.13' ] | ||
| java: [ 8 ] | ||
|
||
| include: | ||
| # Spark 4.0 requires Java 11+ (using Java 17) | ||
| - spark: '4.0' | ||
| scala: '2.13' | ||
| java: 17 | ||
| exclude: | ||
| # Spark 4.0 only supports Scala 2.13 | ||
| - spark: '4.0' | ||
| scala: '2.12' | ||
| # Spark 4.0 requires Java 11+ | ||
| - spark: '4.0' | ||
| java: 8 | ||
| env: | ||
| CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }} | ||
| CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }} | ||
|
|
@@ -44,7 +57,7 @@ jobs: | |
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: zulu | ||
| java-version: 8 | ||
| java-version: ${{ matrix.java }} | ||
| cache: gradle | ||
| - name: Wake up ClickHouse Cloud instance | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,14 +30,27 @@ jobs: | |||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| spark: [ 3.3, 3.4, 3.5 ] | ||||||
| scala: [ 2.12, 2.13 ] | ||||||
| spark: [ '3.3', '3.4', '3.5', '4.0' ] | ||||||
| scala: [ '2.12', '2.13' ] | ||||||
| java: [ 8 ] | ||||||
|
||||||
| include: | ||||||
| # Spark 4.0 requires Java 11+ (using Java 17) | ||||||
| - spark: '4.0' | ||||||
| scala: '2.13' | ||||||
| java: 17 | ||||||
| exclude: | ||||||
| # Spark 4.0 only supports Scala 2.13 | ||||||
| - spark: '4.0' | ||||||
| scala: '2.12' | ||||||
| # Spark 4.0 requires Java 11+ | ||||||
|
||||||
| # Spark 4.0 requires Java 11+ | |
| # Spark 4.0 requires Java 17+ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,7 +106,11 @@ allprojects { | |
| subprojects { | ||
| apply plugin: "scala" | ||
| apply plugin: "java-library" | ||
| apply plugin: "org.scoverage" | ||
| // Disable scoverage when running Metals' bloopInstall to avoid plugin resolution issues | ||
| def isBloopInstall = gradle.startParameter.taskNames.any { it.contains('bloopInstall') } | ||
|
Collaborator
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. Did you check if it does not affect IntelliJ?
Collaborator
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. It shouldn't affect as IntelliJ uses its own build server and it doesn't use Bloop at all |
||
| if (!project.hasProperty('disableScoverage') && !isBloopInstall) { | ||
| apply plugin: "org.scoverage" | ||
| } | ||
| apply plugin: "com.diffplug.spotless" | ||
| apply plugin: "com.github.maiflai.scalatest" | ||
|
|
||
|
|
@@ -168,11 +172,13 @@ subprojects { | |
| } | ||
| } | ||
|
|
||
| scoverage { | ||
| scoverageVersion = "2.0.11" | ||
| reportDir.set(file("${rootProject.buildDir}/reports/scoverage")) | ||
| highlighting.set(false) | ||
| minimumRate.set(0.0) | ||
| if (plugins.hasPlugin('org.scoverage')) { | ||
| scoverage { | ||
| scoverageVersion = "2.0.11" | ||
| reportDir.set(file("${rootProject.buildDir}/reports/scoverage")) | ||
| highlighting.set(false) | ||
| minimumRate.set(0.0) | ||
| } | ||
| } | ||
|
|
||
| spotless { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,10 +16,10 @@ mavenCentralMirror=https://repo1.maven.org/maven2/ | |
| mavenSnapshotsRepo=https://central.sonatype.com/repository/maven-snapshots/ | ||
| mavenReleasesRepo=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ | ||
|
|
||
| systemProp.scala_binary_version=2.12 | ||
| systemProp.scala_binary_version=2.13 | ||
| systemProp.known_scala_binary_versions=2.12,2.13 | ||
| systemProp.spark_binary_version=3.5 | ||
| systemProp.known_spark_binary_versions=3.3,3.4,3.5 | ||
| systemProp.spark_binary_version=4.0 | ||
| systemProp.known_spark_binary_versions=3.3,3.4,3.5,4.0 | ||
|
|
||
| group=com.clickhouse.spark | ||
|
|
||
|
|
@@ -29,26 +29,32 @@ clickhouse_client_v2_version=0.9.4 | |
| spark_33_version=3.3.4 | ||
| spark_34_version=3.4.2 | ||
| spark_35_version=3.5.1 | ||
| spark_40_version=4.0.1 | ||
|
|
||
| spark_33_scala_212_version=2.12.15 | ||
| spark_34_scala_212_version=2.12.17 | ||
| spark_35_scala_212_version=2.12.18 | ||
| spark_40_scala_212_version=2.12.18 | ||
|
||
|
|
||
| spark_33_scala_213_version=2.13.8 | ||
| spark_34_scala_213_version=2.13.8 | ||
| spark_35_scala_213_version=2.13.8 | ||
| spark_40_scala_213_version=2.13.8 | ||
|
|
||
| spark_33_antlr_version=4.8 | ||
| spark_34_antlr_version=4.9.3 | ||
| spark_35_antlr_version=4.9.3 | ||
| spark_40_antlr_version=4.13.1 | ||
|
|
||
| spark_33_jackson_version=2.13.4 | ||
| spark_34_jackson_version=2.14.2 | ||
| spark_35_jackson_version=2.15.2 | ||
| spark_40_jackson_version=2.17.0 | ||
|
|
||
| spark_33_slf4j_version=1.7.32 | ||
| spark_34_slf4j_version=2.0.6 | ||
| spark_35_slf4j_version=2.0.7 | ||
| spark_40_slf4j_version=2.0.7 | ||
|
|
||
| # Align with Apache Spark, and don't bundle them in release jar. | ||
| commons_lang3_version=3.12.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| project.ext { | ||
| spark_version = project.getProperty("spark_40_version") | ||
| spark_binary_version = "4.0" | ||
| } | ||
|
|
||
|
|
||
| project(":clickhouse-spark-${spark_binary_version}_$scala_binary_version") { | ||
| dependencies { | ||
| api project(":clickhouse-core") | ||
|
|
||
| compileOnly "org.apache.spark:spark-sql_$scala_binary_version:$spark_version" | ||
|
|
||
| testImplementation "org.apache.spark:spark-sql_$scala_binary_version:$spark_version" | ||
| testImplementation "org.scalatest:scalatest_$scala_binary_version:$scalatest_version" | ||
| testRuntimeOnly "com.vladsch.flexmark:flexmark-all:$flexmark_version" | ||
| } | ||
| } | ||
|
|
||
| project(":clickhouse-spark-runtime-${spark_binary_version}_$scala_binary_version") { | ||
| apply plugin: "com.github.johnrengelman.shadow" | ||
|
|
||
| tasks.jar.dependsOn tasks.shadowJar | ||
|
|
||
| dependencies { | ||
| compileOnly "org.scala-lang:scala-library:$scala_version" | ||
|
|
||
| implementation(project(":clickhouse-spark-${spark_binary_version}_$scala_binary_version")) { | ||
| exclude group: "org.antlr", module: "antlr4-runtime" | ||
| exclude group: "org.scala-lang", module: "scala-library" | ||
| exclude group: "org.slf4j", module: "slf4j-api" | ||
| exclude group: "org.apache.commons", module: "commons-lang3" | ||
| exclude group: "com.clickhouse", module: "clickhouse-jdbc" | ||
| exclude group: "com.fasterxml.jackson.core" | ||
| exclude group: "com.fasterxml.jackson.datatype" | ||
| exclude group: "com.fasterxml.jackson.module" | ||
| } | ||
| } | ||
|
|
||
| shadowJar { | ||
| zip64=true | ||
| archiveClassifier=null | ||
|
|
||
| mergeServiceFiles() | ||
| } | ||
|
|
||
| jar { | ||
| archiveClassifier="empty" | ||
| manifest { | ||
| attributes( | ||
| 'Implementation-Title': 'Spark-ClickHouse-Connector', | ||
| 'Implementation-Version': "${spark_binary_version}_${scala_binary_version}_${getProjectVersion()}" | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| project(":clickhouse-spark-it-${spark_binary_version}_$scala_binary_version") { | ||
| dependencies { | ||
| implementation "org.scala-lang:scala-library:$scala_version" // for scala plugin detect scala binary version | ||
|
|
||
| testImplementation project(path: ":clickhouse-spark-runtime-${spark_binary_version}_$scala_binary_version", configuration: "shadow") | ||
| testImplementation(testFixtures(project(":clickhouse-core"))) { | ||
| exclude module: "clickhouse-core" | ||
| } | ||
|
|
||
| testImplementation "org.apache.spark:spark-sql_$scala_binary_version:$spark_version" | ||
|
|
||
| testImplementation "org.apache.spark:spark-core_$scala_binary_version:$spark_version:tests" | ||
| testImplementation "org.apache.spark:spark-catalyst_$scala_binary_version:$spark_version:tests" | ||
| testImplementation "org.apache.spark:spark-sql_$scala_binary_version:$spark_version:tests" | ||
|
|
||
| testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" | ||
|
|
||
| testImplementation("com.clickhouse:clickhouse-jdbc:$clickhouse_jdbc_version:all") { transitive = false } | ||
|
|
||
| testImplementation "org.apache.kyuubi:kyuubi-spark-connector-tpcds_${scala_binary_version}:$kyuubi_version" | ||
| } | ||
|
|
||
| test { | ||
| classpath += files("${project(':clickhouse-core').projectDir}/src/testFixtures/conf") | ||
| } | ||
|
|
||
| slowTest { | ||
| classpath += files("${project(':clickhouse-core').projectDir}/src/testFixtures/conf") | ||
| } | ||
|
|
||
| cloudTest { | ||
| classpath += files("${project(':clickhouse-core').projectDir}/src/testFixtures/conf") | ||
| } | ||
| } |
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.
I think we can merge
run-testsandrun-tests-with-specific-clickhouseinto one test. Do you know what version we are running onrun-testsThere 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.
The
run-testsrun on 23.8 (the default version in theClickHouseSingleMixInfile).We could merge them into one test but then we'll need to update the matrix that would run all tests on all CH versions (might actually be a good idea but it'll create a lot of new tests. maybe we should change this only when we fix the tests so that they will be able to run concurrently)
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.
In general, this test is against local ClickHouse, not the cloud, so it does not have the concurrency issue