Skip to content

Commit 343bcfe

Browse files
authored
Merge branch 'main' into fea/add-TableWriterBuilder-insertHandle-method
2 parents e3f6421 + 17d5f83 commit 343bcfe

File tree

847 files changed

+54136
-39317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

847 files changed

+54136
-39317
lines changed

.github/workflows/build_pyvelox.yml

+56-49
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ on:
3232
# - cron: '15 0 * * *'
3333
pull_request:
3434
paths:
35-
- 'velox/**'
36-
- '!velox/docs/**'
37-
- 'third_party/**'
38-
- 'pyvelox/**'
3935
- '.github/workflows/build_pyvelox.yml'
4036

4137
permissions:
@@ -46,23 +42,22 @@ concurrency:
4642
cancel-in-progress: true
4743

4844
jobs:
49-
# TODO: https://github.com/facebookincubator/velox/issues/9014
50-
if: false
5145
build_wheels:
5246
name: Build wheels on ${{ matrix.os }}
5347
runs-on: ${{ matrix.os }}
5448
strategy:
5549
fail-fast: false
5650
matrix:
57-
os: [ubuntu-22.04]
51+
os: [8-core-ubuntu, macos-13, macos-14]
5852
steps:
59-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6054
with:
6155
ref: ${{ inputs.ref || github.ref }}
6256
fetch-depth: 0
6357
submodules: recursive
58+
persist-credentials: false
6459

65-
- uses: actions/setup-python@v4
60+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
6661
with:
6762
python-version: '3.10'
6863

@@ -90,76 +85,87 @@ jobs:
9085
# NEXT_VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF++ ; print}')
9186
echo "build_version=${VERSION}a${COMMITS_SINCE_TAG}" >> $GITHUB_OUTPUT
9287
93-
- run: mkdir -p ccache
9488
- name: "Restore ccache"
95-
uses: actions/cache/restore@v3
89+
# CCache doesn't hit in cibuildwheel
90+
if: startsWith(matrix.os, 'macos')
91+
uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
9692
id: restore-cache
9793
with:
9894
path: "ccache"
99-
key: ccache-wheels-${{ matrix.os }}-${{ github.sha }}
100-
restore-keys: |
101-
ccache-wheels-${{ matrix.os }}-
95+
key: ccache-wheels-${{ matrix.os }}
96+
97+
- name: "Restore macOS Dependencies"
98+
if: startsWith(matrix.os, 'macos')
99+
uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
100+
id: restore-deps
101+
with:
102+
path: "dependencies"
103+
key: dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }}
102104

103105
- name: Install macOS dependencies
104-
if: matrix.os == 'macos-11'
106+
if: ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }}
107+
env:
108+
MACOSX_DEPLOYMENT_TARGET: "13.0"
105109
run: |
106-
echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1/" >> $GITHUB_ENV
107-
bash scripts/setup-macos.sh &&
108-
bash scripts/setup-macos.sh install_folly
110+
export INSTALL_PREFIX="$GITHUB_WORKSPACE/dependencies"
111+
echo "CMAKE_PREFIX_PATH=$INSTALL_PREFIX" >> $GITHUB_ENV
112+
echo "DYLD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
113+
bash scripts/setup-macos.sh
114+
115+
- name: "Save macOS Dependencies"
116+
if: ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }}
117+
uses: apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4
118+
with:
119+
path: "dependencies"
120+
key: dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }}
121+
retention-days: 90
109122

110123
- name: "Create sdist"
111-
if: matrix.os == 'ubuntu-22.04'
124+
if: matrix.os == '8-core-ubuntu'
112125
env:
113126
BUILD_VERSION: "${{ inputs.version || steps.version.outputs.build_version }}"
114127
run: |
115128
python setup.py sdist --dist-dir wheelhouse
116129
117130
- name: Build wheels
118-
uses: pypa/cibuildwheel@v2.22.0
131+
uses: pypa/cibuildwheel@6cccd09a31908ffd175b012fb8bf4e1dbda3bc6c # v2
119132
env:
120-
# required for preadv/pwritev
121-
MACOSX_DEPLOYMENT_TARGET: "11.0"
122-
CIBW_ARCHS: "x86_64"
123-
# On PRs only build for Python 3.7
124-
CIBW_BUILD: ${{ github.event_name == 'pull_request' && 'cp37-*' || 'cp3*' }}
133+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '14' || '13' }}
134+
CIBW_ARCHS: "native"
135+
# Only build for 3.12 for now
136+
CIBW_BUILD: ${{ github.event_name == 'pull_request' && 'cp312-*' || 'cp312-*' }}
125137
CIBW_SKIP: "*musllinux* cp36-*"
126-
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/facebookincubator/velox-dev:torcharrow-avx"
127-
CIBW_BEFORE_ALL_LINUX: >
128-
mkdir -p /output &&
129-
cp -R /host${{ github.workspace }}/ccache /output/ccache &&
130-
ccache -s
131-
CIBW_ENVIRONMENT_PASS_LINUX: CCACHE_DIR BUILD_VERSION
138+
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/facebookincubator/velox-dev:pyvelox"
139+
CIBW_ENVIRONMENT_PASS_LINUX: "BUILD_VERSION"
140+
# Don't waste time writing out to cache
141+
CIBW_ENVIRONMENT_LINUX: "CCACHE_DISABLE=true"
132142
CIBW_TEST_EXTRAS: "tests"
133143
CIBW_TEST_COMMAND: "cd {project}/pyvelox && python -m unittest -v"
134-
CIBW_TEST_SKIP: "*macos*"
135-
CCACHE_DIR: "${{ matrix.os != 'macos-11' && '/output' || github.workspace }}/ccache"
144+
CIBW_TEST_SKIP: "*"
145+
CCACHE_DIR: "${{ github.workspace }}/ccache"
136146
BUILD_VERSION: "${{ inputs.version || steps.version.outputs.build_version }}"
137147
with:
138148
output-dir: wheelhouse
139149

140-
- name: "Move ccache to workspace"
141-
if: matrix.os != 'macos-11'
142-
run: |
143-
mkdir -p ccache
144-
cp -R ./wheelhouse/ccache/* ccache
145-
146150
- name: "Save ccache"
147-
uses: actions/cache/save@v3
148-
id: cache
151+
# CCache doesn't hit in cibuildwheel
152+
if: startsWith(matrix.os, 'macos')
153+
uses: apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4
149154
with:
150155
path: "ccache"
151-
key: ccache-wheels-${{ matrix.os }}-${{ github.sha }}
156+
key: ccache-wheels-${{ matrix.os }}
152157

153158
- name: "Rename wheel compatibility tag"
154-
if: matrix.os == 'macos-11'
159+
if: false #startsWith(matrix.os, 'macos')
155160
run: |
156161
brew install rename
157162
cd wheelhouse
158163
rename 's/11_0/10_15/g' *.whl
159164
160-
- uses: actions/upload-artifact@v4
165+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
161166
with:
162-
name: wheels
167+
name: wheels-${{ matrix.os }}
168+
retention-days: 5
163169
path: |
164170
./wheelhouse/*.whl
165171
./wheelhouse/*.tar.gz
@@ -170,19 +176,20 @@ jobs:
170176
needs: build_wheels
171177
runs-on: ubuntu-22.04
172178
steps:
173-
- uses: actions/download-artifact@v4
179+
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
174180
with:
175-
name: wheels
181+
pattern: wheels-*
182+
merge-multiple: true
176183
path: ./wheelhouse
177184

178185
- run: ls wheelhouse
179186

180-
- uses: actions/setup-python@v3
187+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
181188
with:
182189
python-version: "3.10"
183190

184191
- name: Publish a Python distribution to PyPI
185-
uses: pypa/gh-action-pypi-publish@v1.12.3
192+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
186193
with:
187194
password: ${{ secrets.PYPI_API_TOKEN }}
188195
packages_dir: wheelhouse

.github/workflows/docker.yml

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
- name: Centos 9
5252
file: "scripts/centos.dockerfile"
5353
tags: "ghcr.io/facebookincubator/velox-dev:centos9"
54+
- name: Pyvelox
55+
file: "scripts/pyvelox.dockerfile"
56+
tags: "ghcr.io/facebookincubator/velox-dev:pyvelox"
5457
- name: Dev
5558
file: "scripts/ubuntu-22.04-cpp.dockerfile"
5659
args: ""

.github/workflows/linux-build-base.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
GTest_SOURCE: BUNDLED
4040
simdjson_SOURCE: BUNDLED
4141
xsimd_SOURCE: BUNDLED
42-
CUDA_VERSION: "12.4"
42+
geos_SOURCE: BUNDLED
43+
CUDA_VERSION: "12.8"
4344
USE_CLANG: "${{ inputs.use-clang && 'true' || 'false' }}"
4445
steps:
4546
- uses: actions/checkout@v4
@@ -88,6 +89,7 @@ jobs:
8889
"-DVELOX_ENABLE_BENCHMARKS=ON"
8990
"-DVELOX_ENABLE_EXAMPLES=ON"
9091
"-DVELOX_ENABLE_ARROW=ON"
92+
"-DVELOX_ENABLE_GEO=ON"
9193
"-DVELOX_ENABLE_PARQUET=ON"
9294
"-DVELOX_ENABLE_HDFS=ON"
9395
"-DVELOX_ENABLE_S3=ON"

.github/workflows/scheduled.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
name: Build
9090
# prevent errors when forks ff their main branch
9191
if: ${{ github.repository == 'facebookincubator/velox' }}
92-
runs-on: 16-core-ubuntu
92+
runs-on: 32-core-ubuntu
9393
container: ghcr.io/facebookincubator/velox-dev:centos9
9494
timeout-minutes: 120
9595
env:
@@ -318,7 +318,7 @@ jobs:
318318
uses: actions/upload-artifact@v4
319319
with:
320320
name: cache_fuzzer
321-
path: velox/_build/debug/velox/exec/tests/velox_cache_fuzzer_test
321+
path: velox/_build/debug/velox/exec/fuzzer/velox_cache_fuzzer
322322
retention-days: "${{ env.RETENTION }}"
323323

324324
- name: Upload table evolution fuzzer
@@ -751,6 +751,8 @@ jobs:
751751
container: ghcr.io/facebookincubator/velox-dev:centos9
752752
needs: compile
753753
timeout-minutes: 120
754+
# Temporarily disable on PRs till flakiness is fixed #12167
755+
if: ${{ github.event_name != 'pull_request' }}
754756
steps:
755757

756758
- name: Download cache fuzzer
@@ -760,24 +762,24 @@ jobs:
760762

761763
- name: Run Cache Fuzzer
762764
run: |
763-
mkdir -p /tmp/cache_fuzzer_test/logs/
764-
chmod -R 777 /tmp/cache_fuzzer_test
765-
chmod +x velox_cache_fuzzer_test
766-
./velox_cache_fuzzer_test \
765+
mkdir -p /tmp/cache_fuzzer/logs/
766+
chmod -R 777 /tmp/cache_fuzzer
767+
chmod +x velox_cache_fuzzer
768+
./velox_cache_fuzzer \
767769
--seed ${RANDOM} \
768770
--duration_sec $DURATION \
769771
--minloglevel=0 \
770772
--stderrthreshold=2 \
771-
--log_dir=/tmp/cache_fuzzer_test/logs \
773+
--log_dir=/tmp/cache_fuzzer/logs \
772774
&& echo -e "\n\Cache fuzzer run finished successfully."
773775
774776
- name: Archive Cache production artifacts
775777
if: ${{ !cancelled() }}
776778
uses: actions/upload-artifact@v4
777779
with:
778-
name: cache-fuzzer-test-logs
780+
name: cache-fuzzer-logs
779781
path: |
780-
/tmp/cache_fuzzer_test
782+
/tmp/cache_fuzzer
781783
782784
table-evolution-fuzzer-run:
783785
name: Table Evolution Fuzzer

CMake/resolve_dependency_modules/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ by Velox. See details on bundling below.
4141
| DuckDB (testing) | 0.8.1 | Yes |
4242
| cpr (testing) | 1.10.15 | Yes |
4343
| arrow | 15.0.0 | Yes |
44+
| geos | 3.13.0 | Yes |
4445

4546
# Bundled Dependency Management
4647
This module provides a dependency management system that allows us to automatically fetch and build dependencies from source if needed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# GEOS Configuration
17+
set(VELOX_GEOS_BUILD_VERSION 3.13.0)
18+
set(VELOX_GEOS_BUILD_SHA256_CHECKSUM
19+
47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4)
20+
string(CONCAT VELOX_GEOS_SOURCE_URL "https://download.osgeo.org/geos/"
21+
"geos-${VELOX_GEOS_BUILD_VERSION}.tar.bz2")
22+
23+
velox_resolve_dependency_url(GEOS)
24+
25+
FetchContent_Declare(
26+
geos
27+
URL ${VELOX_GEOS_SOURCE_URL}
28+
URL_HASH ${VELOX_GEOS_BUILD_SHA256_CHECKSUM})
29+
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
30+
FetchContent_MakeAvailable(geos)
31+
unset(BUILD_SHARED_LIBS)

CMake/resolve_dependency_modules/gflags.cmake

+13
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,20 @@ set(GFLAGS_IS_SUBPROJECT ON)
4343

4444
# Workaround for https://github.com/gflags/gflags/issues/277
4545
unset(BUILD_SHARED_LIBS)
46+
if(DEFINED CACHE{BUILD_SHARED_LIBS})
47+
set(CACHED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
48+
unset(BUILD_SHARED_LIBS CACHE)
49+
endif()
50+
4651
FetchContent_MakeAvailable(gflags)
52+
53+
# Workaround for https://github.com/gflags/gflags/issues/277
54+
if(DEFINED CACHED_BUILD_SHARED_LIBS)
55+
set(BUILD_SHARED_LIBS
56+
${CACHED_BUILD_SHARED_LIBS}
57+
CACHE BOOL "Restored after setting up gflags" FORCE)
58+
endif()
59+
4760
# This causes find_package(gflags) in other dependencies to search in the build
4861
# directory and prevents the system gflags from being found when they don't use
4962
# the target directly (like folly).

CMake/resolve_dependency_modules/gtest.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ velox_resolve_dependency_url(GTEST)
2424

2525
message(STATUS "Building gtest from source")
2626
FetchContent_Declare(
27-
gtest
27+
googletest
2828
URL ${VELOX_GTEST_SOURCE_URL}
2929
URL_HASH ${VELOX_GTEST_BUILD_SHA256_CHECKSUM}
3030
OVERRIDE_FIND_PACKAGE SYSTEM EXCLUDE_FROM_ALL)
3131

32-
FetchContent_MakeAvailable(gtest)
32+
FetchContent_MakeAvailable(googletest)
3333

3434
# Mask compilation warning in clang 16.
3535
target_compile_options(gtest PRIVATE -Wno-implicit-int-float-conversion)

0 commit comments

Comments
 (0)