Skip to content

Commit

Permalink
support built with java 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Feb 19, 2024
1 parent db79910 commit bbc028c
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 73 deletions.
12 changes: 10 additions & 2 deletions .github/actions/java-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ runs:
- name: Run Maven compile
shell: bash
run: |
./mvnw compile test-compile scalafix:scalafix -Psemanticdb
if [ $JAVA_VERSION == "8" ]; then
./mvnw -B compile test-compile scalafix:scalafix -Psemanticdb -Djava.version=1.8
else
./mvnw -B compile test-compile scalafix:scalafix -Psemanticdb -Djava.version=${JAVA_VERSION}
fi
- name: Run tests
shell: bash
run: |
SPARK_HOME=`pwd` ./mvnw clean install
if [ $JAVA_VERSION == "8" ]; then
SPARK_HOME=`pwd` ./mvnw -B clean install -Djava.version=1.8
else
SPARK_HOME=`pwd` ./mvnw -B clean install -Djava.version=${JAVA_VERSION}
fi
15 changes: 12 additions & 3 deletions .github/actions/rust-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,24 @@ runs:
shell: bash
run: |
cd common
../mvnw clean compile -DskipTests
if [ $JAVA_VERSION == "8" ]; then
../mvnw clean -B compile -DskipTests -Djava.version=1.8
else
../mvnw clean -B compile -DskipTests -Djava.version=${JAVA_VERSION}
fi
- name: Run Cargo test
shell: bash
run: |
cd core
# This is required to run some JNI related tests on the Rust side
JAVA_LD_LIBRARY_PATH=$JAVA_HOME/lib/server:$JAVA_HOME/lib:$JAVA_HOME/lib/jli
# special handing for java 1.8 for both linux and mac distributions
if [ $JAVA_VERSION == "8" ]; then
JAVA_LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/jli:$JAVA_HOME/jre/lib/server:$JAVA_HOME/jre/lib:$JAVA_HOME/jre/lib/jli
fi
RUST_BACKTRACE=1 \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib:$JAVA_HOME/lib/server:$JAVA_HOME/lib/jli \
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$JAVA_HOME/lib:$JAVA_HOME/lib/server:$JAVA_HOME/lib/jli \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_LD_LIBRARY_PATH \
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$JAVA_LD_LIBRARY_PATH \
cargo test
2 changes: 1 addition & 1 deletion .github/actions/setup-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
- name: Install JDK ${{inputs.jdk-version}}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'zulu'
java-version: ${{inputs.jdk-version}}

- name: Set JAVA_HOME
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-macos-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
- name: Install JDK ${{inputs.jdk-version}}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'zulu'
java-version: ${{inputs.jdk-version}}
architecture: ${{inputs.jdk-architecture}}

Expand Down
108 changes: 46 additions & 62 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,105 +35,89 @@ on:
workflow_dispatch:

env:
JAVA_VERSION: 17
RUST_VERSION: nightly

jobs:
linux-rust-test:
name: Rust test (amd64)
runs-on: ubuntu-latest
linux-java-or-rust-test:
strategy:
matrix:
os: [ubuntu-latest]
java_version: [8, 17]
test-target: [rust, java]
fail-fast: false
name: ${{ matrix.test-target }} test on ${{ matrix.os }} with java ${{ matrix.java_version }}
runs-on: ${{ matrix.os }}
container:
image: amd64/rust
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Java toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{env.RUST_VERSION}}
jdk-version: ${{env.JAVA_VERSION}}
jdk-version: ${{ matrix.java_version }}

- uses: actions/checkout@v4
- name: Rust test steps
- if: matrix.test-target == 'rust'
name: Rust test steps
uses: ./.github/actions/rust-test

linux-java-test:
name: Java test (amd64)
runs-on: ubuntu-latest
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: ${{env.JAVA_VERSION}}

- uses: actions/checkout@v4
- name: Java test steps
- if: matrix.test-target == 'java'
name: Java test steps
uses: ./.github/actions/java-test


macos-rust-test:
name: Rust test (macos)
runs-on: macos-latest
macos-java-or-rust-test:
strategy:
matrix:
os: [macos-latest]
java_version: [8, 17]
test-target: [rust, java]
fail-fast: false
name: ${{ matrix.test-target }} test on ${{ matrix.os }} with java ${{ matrix.java_version }}
runs-on: ${{ matrix.os }}
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Java toolchain
uses: ./.github/actions/setup-macos-builder
with:
rust-version: ${{env.RUST_VERSION}}
jdk-version: ${{env.JAVA_VERSION}}
jdk-version: ${{ matrix.java_version }}

- uses: actions/checkout@v4
- name: Rust test steps
- if: matrix.test-target == 'rust'
name: Rust test steps
uses: ./.github/actions/rust-test

macos-java-test:
name: Java test (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Java toolchain
uses: ./.github/actions/setup-macos-builder
with:
rust-version: ${{env.RUST_VERSION}}
jdk-version: ${{env.JAVA_VERSION}}

- uses: actions/checkout@v4
- name: Java test steps
- if: matrix.test-target == 'java'
name: Java test steps
uses: ./.github/actions/java-test

macos-aarch64-rust-test:
name: Rust test (macos-aarch64)
macos-aarch64-java-or-rust-test:
strategy:
matrix:
java_version: [8, 17]
test-target: [rust, java]
fail-fast: false
name: ${{ matrix.test-target }} (macos-aarch64) test with java ${{ matrix.java_version }}
runs-on: macos-14
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Java toolchain
uses: ./.github/actions/setup-macos-builder
with:
rust-version: ${{env.RUST_VERSION}}
jdk-version: ${{env.JAVA_VERSION}}
jdk-version: ${{ matrix.java_version }}
jdk-architecture: aarch64
protoc-architecture: aarch_64

- uses: actions/checkout@v4
- name: Rust test steps
- if: matrix.test-target == 'rust'
name: Rust test steps
uses: ./.github/actions/rust-test

macos-aarch64-java-test:
name: Java test (macos-aarch64)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Java toolchain
uses: ./.github/actions/setup-macos-builder
with:
rust-version: ${{env.RUST_VERSION}}
jdk-version: ${{env.JAVA_VERSION}}
jdk-architecture: aarch64
protoc-architecture: aarch_64

- uses: actions/checkout@v4
- name: Java test steps
- if: matrix.test-target == 'java'
name: Java test steps
uses: ./.github/actions/java-test
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ under the License.
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<version>4.9.9</version>
<executions>
<execution>
<id>get-the-git-infos</id>
Expand Down
4 changes: 4 additions & 0 deletions common/src/main/java/org/apache/comet/parquet/FileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ private class ConsecutivePartList {
private final SQLMetric readThroughput;

/**
* Constructor
*
* @param offset where the first chunk starts
*/
ConsecutivePartList(long offset) {
Expand Down Expand Up @@ -1104,6 +1106,8 @@ private void setReadMetrics(long startNs) {
}

/**
* End position of the last byte of these chunks
*
* @return the position following the last byte of these chunks
*/
public long endPos() {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ under the License.
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<scala.version>2.12.17</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<scala.plugin.version>4.7.2</scala.plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object GenTPCHData {
// Generate data
// Since dbgen may uses stdout to output the data, tables.genData needs to run table by table
val tableNames =
if (config.tableFilter.isBlank) tables.tables.map(_.name) else Seq(config.tableFilter)
if (config.tableFilter.trim.isEmpty) tables.tables.map(_.name) else Seq(config.tableFilter)
tableNames.foreach { tableName =>
tables.genData(
location = s"${config.location}/tpch/sf${config.scaleFactor}_${config.format}",
Expand Down

0 comments on commit bbc028c

Please sign in to comment.