Skip to content
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

feat(query): add python udf script runtime #15494

Merged
merged 28 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eeaba40
feat(query): add py script
sundy-li May 9, 2024
c3de829
Merge branch 'main' into py-udf
sundy-li May 11, 2024
4fbc873
feat(query): disable bendpy
sundy-li May 13, 2024
daf490b
Merge branch 'main' into py-udf
sundy-li May 13, 2024
e07d92a
feat(query): fmt
sundy-li May 13, 2024
2fc0b1f
feat(query): fmt
sundy-li May 13, 2024
4f30b54
feat(query): fmt
sundy-li May 13, 2024
fd65efc
feat(query): fmt
sundy-li May 13, 2024
6acdbaa
feat(query): python 3.12.2
sundy-li May 13, 2024
0784800
Merge branch 'main' into py-udf
sundy-li May 13, 2024
95b6036
Merge branch 'main' into py-udf
sundy-li May 13, 2024
535fcfc
Merge branch 'main' into py-udf
sundy-li May 14, 2024
cc5226c
update PYO3_CROSS_PYTHON_VERSION
sundy-li May 14, 2024
96eef9c
Merge branch 'main' into py-udf
sundy-li May 15, 2024
c1a031a
Merge branch 'main' into py-udf
sundy-li May 15, 2024
b487c36
Merge branch 'main' into py-udf
sundy-li May 21, 2024
fe87632
update
sundy-li May 21, 2024
0a51519
Merge branch 'py-udf' of github.com:sundy-li/fuse-query into py-udf
sundy-li May 24, 2024
1dc4fa8
Merge branch 'main' into py-udf
sundy-li May 24, 2024
bff7d7b
merge
sundy-li May 24, 2024
7631344
update
sundy-li May 24, 2024
f590854
update
sundy-li May 24, 2024
368ef3e
update
sundy-li May 24, 2024
63c2a8d
update
sundy-li May 25, 2024
621f1ee
Merge branch 'main' into py-udf
sundy-li May 25, 2024
59005b4
Merge branch 'main' into py-udf
sundy-li May 27, 2024
4109657
update feature name
sundy-li May 27, 2024
69c629c
Merge branch 'py-udf' of github.com:sundy-li/fuse-query into py-udf
sundy-li May 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/actions/build_linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
uses: ./.github/actions/setup_build_tool
with:
target: ${{ inputs.target }}
bypass_env_vars: RUSTFLAGS,RUST_LOG
bypass_env_vars: RUSTFLAGS,RUST_LOG,PYO3_PYTHON,LD_LIBRARY_PATH,PYO3_CROSS_PYTHON_VERSION

- name: Cross setup
if: startsWith(inputs.target, 'aarch64-')
Expand Down Expand Up @@ -61,6 +61,9 @@ runs:
echo "RUSTFLAGS=${flags} -C link-arg=-Wl,--compress-debug-sections=zlib" >> $GITHUB_ENV
target=${{ inputs.target }}
echo "BUILD_ARCH=${target/-unknown-linux-*}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
echo "PYO3_PYTHON=python3.12" >> $GITHUB_ENV
echo "PYO3_CROSS_PYTHON_VERSION=/3.12" >> $GITHUB_ENV

# build all binaries for debug
- name: Build Debug
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build_linux_sanitizer/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
uses: ./.github/actions/setup_build_tool
with:
target: ${{ inputs.target }}
bypass_env_vars: RUSTFLAGS,RUST_LOG
bypass_env_vars: RUSTFLAGS,RUST_LOG,PYO3_PYTHON,LD_LIBRARY_PATH

- name: Cross setup
if: startsWith(inputs.target, 'aarch64-')
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
- name: Setup Build Tool
uses: ./.github/actions/setup_build_tool
with:
bypass_env_vars: RUSTFLAGS,RUST_LOG,GITHUB_TOKEN
bypass_env_vars: RUSTFLAGS,RUST_LOG,GITHUB_TOKEN,PYO3_PYTHON,LD_LIBRARY_PATH

- name: Check Apache License Header
uses: korandoru/hawkeye@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/setup_build_tool/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
bypass_env_vars:
description: "Environment variables bypass to docker container"
required: false
default: RUSTFLAGS,RUST_LOG
default: RUSTFLAGS,RUST_LOG,PYO3_PYTHON,LD_LIBRARY_PATH
runs:
using: "composite"
steps:
Expand All @@ -28,6 +28,9 @@ runs:
cat <<EOF >$BIN_LOCAL/build-tool
#!/bin/bash
script_name=\$(basename "\$0")
export PYO3_PYTHON=python3.12
export LD_LIBRARY_PATH=/usr/local/lib
export PYO3_CROSS_PYTHON_VERSION=3.12
export INTERACTIVE=false
export TARGET=${{ inputs.target }}
export CARGO_INCREMENTAL=0
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test_unit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup Build Tool
uses: ./.github/actions/setup_build_tool
with:
bypass_env_vars: RUSTFLAGS,RUSTDOCFLAGS,RUST_TEST_THREADS,RUST_LOG,RUST_BACKTRACE
bypass_env_vars: RUSTFLAGS,RUSTDOCFLAGS,RUST_TEST_THREADS,RUST_LOG,RUST_BACKTRACE,PYO3_PYTHON,LD_LIBRARY_PATH

- shell: bash
run: |
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/bindings.python.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Bindings Python

on:
pull_request:
branches:
- main
paths:
- "src/**"
- ".github/workflows/bindings.python.yml"
workflow_call:
inputs:
tag:
description: Tag to release
required: true
type: string
## uncomment it when bendpy is enabled
workflow_dispatch:
# pull_request:
# branches:
# - main
# paths:
# - "src/**"
# - ".github/workflows/bindings.python.yml"
# workflow_call:
# inputs:
# tag:
# description: Tag to release
# required: true
# type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,13 @@ jobs:
with:
name: test-sqlsmith

bindings_python:
if: inputs.stable
needs: create_release
uses: ./.github/workflows/bindings.python.yml
secrets: inherit
with:
tag: ${{ needs.create_release.outputs.version }}
# bindings_python:
# if: inputs.stable
# needs: create_release
# uses: ./.github/workflows/bindings.python.yml
# secrets: inherit
# with:
# tag: ${{ needs.create_release.outputs.version }}

notify:
runs-on: ubuntu-latest
Expand Down
94 changes: 33 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ members = [
"src/meta/service",
# sqllogictest
"tests/sqllogictests",
"src/bendpy",
# "src/bendpy",
# sqlsmith
"src/tests/sqlsmith",
]
Expand Down
2 changes: 1 addition & 1 deletion src/bendpy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "databend"
requires-python = ">=3.7"
requires-python = ">=3.12"
description = "Databend Python Binding"
classifiers = [
"Programming Language :: Rust",
Expand Down
1 change: 1 addition & 0 deletions src/binaries/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ memory-profiling = [
"databend-query/memory-profiling",
"databend-common-base/memory-profiling",
]
python-udf = ["databend-query/python-udf"]
simd = ["databend-meta/simd", "databend-query/simd"]
z3-prove = ["databend-query/z3-prove"]
jemalloc = ["databend-common-base/jemalloc"]
Expand Down
1 change: 1 addition & 0 deletions src/common/exception/src/exception_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ build_exceptions! {
///
/// For example: license key is expired
LicenseKeyInvalid(1402),
EnterpriseFeatureNotEnable(1403),

BackgroundJobAlreadyExists(1501),
UnknownBackgroundJob(1502),
Expand Down
3 changes: 2 additions & 1 deletion src/query/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test = true
[features]
default = ["simd", "z3-prove"]
simd = ["databend-common-arrow/simd"]

python-udf = ["arrow-udf-python"]
z3-prove = ["databend-common-sql/z3-prove"]
disable_initial_exec_tls = ["databend-common-base/disable_initial_exec_tls"]

Expand Down Expand Up @@ -103,6 +103,7 @@ jsonb = { workspace = true }

# Crates.io dependencies
arrow-udf-js = { workspace = true }
arrow-udf-python = { package = "arrow-udf-python", git = "https://github.com/datafuse-extras/arrow-udf", rev = "d0a21f0", optional = true }
arrow-udf-wasm = { workspace = true }

arrow-array = { workspace = true }
Expand Down
Loading
Loading