Skip to content

[VL] Enable native Window execution for TIMESTAMP_NTZ partition/order-by keys #8411

[VL] Enable native Window execution for TIMESTAMP_NTZ partition/order-by keys

[VL] Enable native Window execution for TIMESTAMP_NTZ partition/order-by keys #8411

# 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: Velox Backend (ARM)
on:
pull_request:
paths:
- '.github/workflows/velox_backend_arm.yml'
- 'pom.xml'
- 'backends-velox/**'
- 'gluten-uniffle/**'
- 'gluten-celeborn/**'
- 'gluten-core/**'
- 'gluten-substrait/**'
- 'gluten-arrow/**'
- 'gluten-delta/**'
- 'gluten-iceberg/**'
- 'gluten-hudi/**'
- 'gluten-paimon/**'
- 'gluten-ut/**'
- 'package/**'
- 'shims/**'
- 'tools/gluten-it/**'
- 'ep/build-velox/**'
- 'cpp/**'
- 'dev/**'
- 'build/mvn'
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
MVN_CMD: 'build/mvn -ntp'
WGET_CMD: 'wget -nv'
CCACHE_DIR: "${{ github.workspace }}/.ccache"
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
# Detect which parts of the codebase were modified so downstream jobs can
# skip work that is irrelevant to the change.
detect-changes:
runs-on: ubuntu-22.04
outputs:
cpp: ${{ steps.filter.outputs.cpp }}
java: ${{ steps.filter.outputs.java }}
tools_it: ${{ steps.filter.outputs.tools_it }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Detect changed paths
id: filter
run: |
BASE=${{ github.event.pull_request.base.sha }}
HEAD=${{ github.sha }}
changed=$(git diff --name-only "$BASE" "$HEAD")
echo "$changed"
match() { echo "$changed" | grep -qE "$1" && echo true || echo false; }
echo "cpp=$(match '^(cpp/|ep/build-velox/|dev/)')" >> $GITHUB_OUTPUT
echo "java=$(match '^(\.github/workflows/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|pom\.xml)|package/|build/mvn)')" >> $GITHUB_OUTPUT
echo "tools_it=$(match '^tools/gluten-it/')" >> $GITHUB_OUTPUT
build-native-lib-centos-8:
needs: detect-changes
runs-on: ubuntu-24.04-arm
container: apache/gluten:vcpkg-centos-9
steps:
- uses: actions/checkout@v7
- name: Install Stash restore dependencies # the stash action needs gh and jq, absent from this container
run: |
case "$(uname -m)" in
x86_64) ARCH=amd64 ;;
aarch64) ARCH=arm64 ;;
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;;
esac
curl -fsSL "https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_linux_${ARCH}.tar.gz" \
| tar -xz -C /usr/local --strip-components=1 "gh_2.63.2_linux_${ARCH}/bin/gh"
curl -fsSL -o /usr/local/bin/jq "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${ARCH}"
chmod +x /usr/local/bin/jq
gh --version && jq --version
- name: Get Ccache from Apache Stash
id: ccache-stash
uses: apache/infrastructure-actions/stash/restore@69afc125e535c4c41e7f1b7470f583087e0f344b
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-default-${{runner.arch}}-${{ hashFiles('ep/build-velox/src/**') }}
- name: Get Ccache from actions/cache (fallback on Stash miss)
if: steps.ccache-stash.outputs.stash-hit != 'true'
uses: actions/cache/restore@v4
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-default-${{runner.arch}}-${{github.sha}}
restore-keys: |
ccache-centos8-release-default-${{runner.arch}}
- name: Build Gluten native libraries
run: |
df -a
export CCACHE_MAXSIZE=1G
mkdir -p $GITHUB_WORKSPACE/.ccache
ccache -sz
bash dev/ci-velox-buildstatic-centos-9.sh
ccache -s
- name: "Save ccache"
if: always()
uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos8-release-default-${{runner.arch}}-${{ hashFiles('ep/build-velox/src/**') }}
include-hidden-files: true
- uses: actions/upload-artifact@v7
with:
name: velox-native-lib-centos-8-${{github.sha}}
path: ./cpp/build/releases/
if-no-files-found: error
tpc-test-centos8:
needs: [detect-changes, build-native-lib-centos-8]
if: >-
needs.detect-changes.outputs.cpp == 'true' ||
needs.detect-changes.outputs.java == 'true' ||
needs.detect-changes.outputs.tools_it == 'true'
strategy:
fail-fast: false
matrix:
os: [ "quay.io/centos/centos:stream9" ]
spark: [ "spark-3.5" ]
java: [ "java-8" ]
runs-on: ubuntu-24.04-arm
container: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Download All Native Artifacts
uses: actions/download-artifact@v8
with:
name: velox-native-lib-centos-8-${{github.sha}}
path: ./cpp/build/releases/
- name: Update mirror list
run: |
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* || true
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* || true
- name: Setup java
run: |
yum update -y && yum install -y java-1.8.0-openjdk-devel wget procps
- name: Set environment variables
run: |
echo "JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk" >> $GITHUB_ENV
- name: Build gluten-it
run: |
echo "JAVA_HOME: $JAVA_HOME"
cd $GITHUB_WORKSPACE/
$MVN_CMD clean install -P${{ matrix.spark }} -P${{ matrix.java }} -Pbackends-velox -DskipTests
cd $GITHUB_WORKSPACE/tools/gluten-it
$GITHUB_WORKSPACE/$MVN_CMD clean install -P${{ matrix.spark }} -P${{ matrix.java }}
- name: Run TPC-H / TPC-DS
run: |
echo "JAVA_HOME: $JAVA_HOME"
cd $GITHUB_WORKSPACE/tools/gluten-it
GLUTEN_IT_JVM_ARGS=-Xmx5G sbin/gluten-it.sh queries-compare \
--local --preset=velox --benchmark-type=h --error-on-memleak --off-heap-size=10g -s=1.0 --threads=16 --iterations=1 \
&& GLUTEN_IT_JVM_ARGS=-Xmx5G sbin/gluten-it.sh queries-compare \
--local --preset=velox --benchmark-type=ds --error-on-memleak --off-heap-size=10g -s=1.0 --threads=16 --iterations=1
cpp-test-udf-test:
needs: detect-changes
if: needs.detect-changes.outputs.cpp == 'true'
runs-on: ubuntu-24.04-arm
container: apache/gluten:centos-9-jdk8
steps:
- uses: actions/checkout@v7
- name: Install Stash restore dependencies # the stash action needs gh and jq, absent from this container
run: |
case "$(uname -m)" in
x86_64) ARCH=amd64 ;;
aarch64) ARCH=arm64 ;;
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;;
esac
curl -fsSL "https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_linux_${ARCH}.tar.gz" \
| tar -xz -C /usr/local --strip-components=1 "gh_2.63.2_linux_${ARCH}/bin/gh"
curl -fsSL -o /usr/local/bin/jq "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${ARCH}"
chmod +x /usr/local/bin/jq
gh --version && jq --version
- name: Get Ccache from Apache Stash
id: ccache-stash
uses: apache/infrastructure-actions/stash/restore@69afc125e535c4c41e7f1b7470f583087e0f344b
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos9-release-shared-${{runner.arch}}-${{ hashFiles('ep/build-velox/src/**') }}
- name: Get Ccache from actions/cache (fallback on Stash miss)
if: steps.ccache-stash.outputs.stash-hit != 'true'
uses: actions/cache/restore@v4
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-centos9-release-shared-${{runner.arch}}-${{github.sha}}
restore-keys: |
ccache-centos9-release-shared-${{runner.arch}}
- name: Build Gluten native libraries
run: |
df -a
bash dev/ci-velox-buildshared-centos-9.sh
ccache -s
- name: Run CPP unit test
run: |
cd ./cpp/build && ctest -V
- name: Run CPP benchmark test
run: |
$MVN_CMD test -Pspark-3.5 -Pbackends-velox -pl backends-velox -am \
-DtagsToInclude="org.apache.gluten.tags.GenerateExample" -Dtest=none -DfailIfNoTests=false -Dexec.skip
# This test depends on files generated by the above mvn test.
./cpp/build/velox/benchmarks/generic_benchmark --with-shuffle --partitioning hash --threads 1 --iterations 1 \
--conf $(realpath backends-velox/generated-native-benchmark/conf_12_0_*.ini) \
--plan $(realpath backends-velox/generated-native-benchmark/plan_12_0_*.json) \
--data $(realpath backends-velox/generated-native-benchmark/data_12_0_*_0.parquet),$(realpath backends-velox/generated-native-benchmark/data_12_0_*_1.parquet)
# - name: Run UDF test
# run: |
# # Depends on --build_example=ON.
# yum update -y
# yum install -y java-17-openjdk-devel
# export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
# export PATH=$JAVA_HOME/bin:$PATH
# java -version
# $MVN_CMD test -Pspark-3.5 -Pbackends-velox -Pjava-17 -Piceberg -Pdelta -Ppaimon -DtagsToExclude=None \
# -DtagsToInclude=org.apache.gluten.tags.UDFTest
- name: Upload test report
uses: actions/upload-artifact@v7
with:
name: ${{ github.job }}-report
path: '**/surefire-reports/TEST-*.xml'
- name: Upload unit tests log files
if: ${{ !success() }}
uses: actions/upload-artifact@v7
with:
name: ${{ github.job }}-test-log
path: "**/target/*.log"