-
Notifications
You must be signed in to change notification settings - Fork 155
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
build: Run Spark SQL tests for 3.4 #166
Merged
+1,450
−0
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
884386b
initial commit
sunchao 7bbd72a
fix checkout
sunchao c307518
build Comet
sunchao 10fc56a
use maven cache
sunchao e76b75b
rat exclude
sunchao 194a5e4
add others
sunchao add07e3
updates
sunchao 0d64757
test
sunchao 17d638f
more fixes
sunchao 0c9ed63
more fixes
sunchao 83f138a
fixes
sunchao 7d76194
more fixes
sunchao fc4f457
final fix (hopefully)
sunchao c43ef49
update diff to support shuffle
sunchao 14c53e9
handle SlowHiveTest
sunchao 6c767f0
revert shuffle changes
sunchao 25b08da
reduce
sunchao d1324ba
fix sbt
sunchao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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 | ||
# | ||
# http://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. | ||
|
||
name: Setup Spark Builder | ||
description: 'Setup Apache Spark to run SQL tests' | ||
inputs: | ||
spark-short-version: | ||
description: 'The Apache Spark short version (e.g., 3.4) to build' | ||
required: true | ||
default: '3.4' | ||
spark-version: | ||
description: 'The Apache Spark version (e.g., 3.4.2) to build' | ||
required: true | ||
default: '3.4.2' | ||
comet-version: | ||
description: 'The Comet version to use for Spark' | ||
required: true | ||
default: '0.1.0-SNAPSHOT' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Clone Spark repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: apache/spark | ||
path: apache-spark | ||
ref: v${{inputs.spark-version}} | ||
fetch-depth: 1 | ||
|
||
- name: Setup Spark for Comet | ||
shell: bash | ||
run: | | ||
cd apache-spark | ||
git apply ../dev/diffs/${{inputs.spark-version}}.diff | ||
../mvnw -nsu -q versions:set-property -Dproperty=comet.version -DnewVersion=${{inputs.comet-version}} -DgenerateBackupPoms=false | ||
|
||
- name: Cache Maven dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
/root/.m2/repository | ||
key: ${{ runner.os }}-spark-sql-${{ hashFiles('spark/**/pom.xml', 'common/**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-spark-sql- | ||
|
||
- name: Build Comet | ||
shell: bash | ||
run: | | ||
PROFILES="-Pspark-${{inputs.spark-short-version}}" make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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 | ||
# | ||
# http://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. | ||
|
||
name: Spark SQL Tests | ||
|
||
concurrency: | ||
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "doc/**" | ||
- "**.md" | ||
pull_request: | ||
paths-ignore: | ||
- "doc/**" | ||
- "**.md" | ||
# manual trigger | ||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | ||
workflow_dispatch: | ||
|
||
env: | ||
RUST_VERSION: nightly | ||
|
||
jobs: | ||
spark-sql-catalyst: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java-version: [11] | ||
spark-version: [{short: '3.4', full: '3.4.2'}] | ||
module: | ||
- {name: "catalyst", args1: "catalyst/test", args2: ""} | ||
- {name: "sql/core-1", args1: "", args2: sql/testOnly * -- -l org.apache.spark.tags.ExtendedSQLTest -l org.apache.spark.tags.SlowSQLTest} | ||
- {name: "sql/core-2", args1: "", args2: "sql/testOnly * -- -n org.apache.spark.tags.ExtendedSQLTest"} | ||
- {name: "sql/core-3", args1: "", args2: "sql/testOnly * -- -n org.apache.spark.tags.SlowSQLTest"} | ||
- {name: "sql/hive-1", args1: "", args2: "hive/testOnly * -- -l org.apache.spark.tags.ExtendedHiveTest -l org.apache.spark.tags.SlowHiveTest"} | ||
- {name: "sql/hive-2", args1: "", args2: "hive/testOnly * -- -n org.apache.spark.tags.ExtendedHiveTest"} | ||
- {name: "sql/hive-3", args1: "", args2: "hive/testOnly * -- -n org.apache.spark.tags.SlowHiveTest"} | ||
fail-fast: false | ||
name: spark-sql-${{ matrix.module.name }}/${{ matrix.os }}/spark-${{ matrix.spark-version.full }}/java-${{ matrix.java-version }} | ||
runs-on: ${{ matrix.os }} | ||
container: | ||
image: amd64/rust | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust & Java toolchain | ||
uses: ./.github/actions/setup-builder | ||
with: | ||
rust-version: ${{env.RUST_VERSION}} | ||
jdk-version: ${{ matrix.java-version }} | ||
- name: Setup Spark | ||
uses: ./.github/actions/setup-spark-builder | ||
with: | ||
spark-version: ${{ matrix.spark-version.full }} | ||
spark-short-version: ${{ matrix.spark-version.short }} | ||
comet-version: '0.1.0-SNAPSHOT' # TODO: get this from pom.xml | ||
- name: Run Spark tests | ||
run: | | ||
cd apache-spark | ||
ENABLE_COMET=true build/sbt ${{ matrix.module.args1 }} "${{ matrix.module.args2 }}" | ||
env: | ||
LC_ALL: "C.UTF-8" | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 can help review this once it's ready.
On the surface, I am concerned to maintain 1k+ patch to make this work. It would be problematic to maintain that. Is there any successful example that has similar setup?
Is it possible to add spark-sql test jar to the project and run tests directly against the test jar with comet enabled and some incompatible tests excluded? That setup simulates how end users uses comet.
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.
It seems difficult to use the test jar approach. Even if we are able to enable Comet for the Spark tests, we'd need to make modifications for many of them as shown in the diff.
On the other hand, the diff is tied to a particular Spark version like 3.4.x, and rarely need to be updated (from our experience). We only need to create a new diff with a new Spark release which typically happens every 6 months to 1 year.
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 see.
But once modification is needed, it would be problematic to update the patches directly. If we are going to go with this approach. I'd like to propose some improvement to refine the maintaining process:
sunchao/spark
to start?git
command.By hosting patches in a dedicated branch, I think we can track all the modifications in history.
Of course, we should include a README in dev/diffs about how the diffs are generated.
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.
Yes, I think it'd be useful to have a forked repo tracking the Comet changes to Spark. Maybe we can just use branches in this repo? We could run tests to validate the changes too through Github CI.
Alternatively we can use my personal Spark fork too but it just doesn't seem like the ideal place (for instance, who should be able to update the repo?).
cc @viirya @kazuyukitanimura @alamb for more inputs.
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.
For updating the diff, I think we can just create a doc to explain how or small script to automate. Basically what we need to cover is
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.
Yes, something like:
where
spark-3.4.2
andspark-3.5.1
are Spark fork with the diff applied. We will need to keep the branch updated since sometimes Comet will introduce breaking changes that require Spark changes. Comparing to personal repo, it is easier to maintain.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.
If we only test with released Spark version, I think the diff is basically no need to changed at all (as the Spark code is not changed), except we have something in Comet which needs to update the diff. It makes me wonder if we need to have the whole Spark codebase only for the diff. 🤔
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.
They may need to be updated when Comet introduces some changes (for instance, an extra parameter for
CometBatchScanExec
) that require Spark side change. One advantage of having the branches is we are able to track the history of all these. IMO it is something good to have but not essential.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.
If it's allowed, then it would be ideal.
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 believe having a fork of the spark code (rather than a diff that is applied to a local checkout) would be eaiser to understand / maintain over the long run.
I think the key would be to make sure what is going on with the branches is well documented (especially the rationale)