diff --git a/.github/actions/artifact_upload/action.yml b/.github/actions/artifact_upload/action.yml index 290e12cf80e40..5e7f19001c101 100644 --- a/.github/actions/artifact_upload/action.yml +++ b/.github/actions/artifact_upload/action.yml @@ -41,9 +41,17 @@ runs: if: env.RUNNER_PROVIDER == 'aws' shell: bash run: | + echo "### artifacts 🚀" >> $GITHUB_STEP_SUMMARY aws s3 sync ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/ \ s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \ --exclude "*" --include "databend-*" --no-progress + artifacts="meta,query,query.debug" + for artifact in ${artifacts//,/ }; do + if [[ -f ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-${artifact} ]]; then + url=$(aws s3 presign s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/databend-${artifact} --expires-in 21600) + echo "- [${artifact}](${url})" >> $GITHUB_STEP_SUMMARY + fi + done - name: Upload artifact to gcs if: env.RUNNER_PROVIDER == 'gcp' diff --git a/.github/actions/build_linux/action.yml b/.github/actions/build_linux/action.yml index 3e5daae8778e1..fc8eacc23039c 100644 --- a/.github/actions/build_linux/action.yml +++ b/.github/actions/build_linux/action.yml @@ -69,11 +69,12 @@ runs: shell: bash run: | artifacts="meta,metactl,metabench,query,sqllogictests" + binaries="" for artifact in ${artifacts//,/ }; do - echo "==> building databend-$artifact ..." - cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --profile ${{ env.BUILD_PROFILE }} --bin databend-$artifact + binaries="${binaries} --bin databend-$artifact" done - ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact + cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --profile ${{ env.BUILD_PROFILE }} ${binaries} + ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-* - name: Build Release for specific artifacts if: inputs.artifacts != 'all' @@ -83,8 +84,8 @@ runs: for artifact in ${artifacts//,/ }; do echo "==> building databend-$artifact ..." cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --profile ${{ env.BUILD_PROFILE }} --bin databend-$artifact + ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact done - ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact - name: Check Binary Info shell: bash diff --git a/.github/actions/pack_binaries/action.yml b/.github/actions/pack_binaries/action.yml index 64d3283b129b9..bc54eedb02e41 100644 --- a/.github/actions/pack_binaries/action.yml +++ b/.github/actions/pack_binaries/action.yml @@ -23,6 +23,14 @@ runs: category: ${{ inputs.category }} path: distro/bin artifacts: metactl,meta,query,query.debug + - name: Download BendSQL + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + verison=$(gh release list --repo databendlabs/bendsql | head -n 1 | awk '{print $1}') + curl -sSLfo /tmp/bendsql.tar.gz https://github.com/databendlabs/bendsql/releases/download/${verison}/bendsql-${verison}-${{ inputs.target }}.tar.gz + tar -xzvf /tmp/bendsql.tar.gz -C distro/bin - name: Pack Binaries id: pack_binaries shell: bash diff --git a/.github/actions/setup_build_tool/action.yml b/.github/actions/setup_build_tool/action.yml index 8e73ddd76894f..32b7e0e53427a 100644 --- a/.github/actions/setup_build_tool/action.yml +++ b/.github/actions/setup_build_tool/action.yml @@ -38,12 +38,12 @@ runs: EOF RUNNER_PROVIDER="${RUNNER_PROVIDER:-github}" - export SCCACHE_IDLE_TIMEOUT=0 case ${RUNNER_PROVIDER} in aws) echo "setting up sccache for AWS S3..." cat <>$BIN_LOCAL/build-tool export ENABLE_SCCACHE=true + export SCCACHE_IDLE_TIMEOUT=0 export SCCACHE_BUCKET=databend-ci export SCCACHE_REGION=us-east-2 export SCCACHE_S3_KEY_PREFIX="cache/sccache/" @@ -57,6 +57,7 @@ runs: echo "setting up sccache for Google Cloud Storage..." cat <>$BIN_LOCAL/build-tool export ENABLE_SCCACHE=true + export SCCACHE_IDLE_TIMEOUT=0 export SCCACHE_GCS_RW_MODE=READ_WRITE export SCCACHE_GCS_BUCKET=databend-ci export SCCACHE_GCS_KEY_PREFIX="cache/sccache/" diff --git a/.github/actions/setup_test/action.yml b/.github/actions/setup_test/action.yml new file mode 100644 index 0000000000000..5c1f60f8f9f07 --- /dev/null +++ b/.github/actions/setup_test/action.yml @@ -0,0 +1,44 @@ +name: "Setup For GNU Test" +description: "Setup For GNU Test" +inputs: + path: + description: "default to ./target/${BUILD_PROFILE}/" + required: false + default: "" + artifacts: + description: "Artifacts to download, only works with s3/gcs" + required: false + default: "meta,query" +runs: + using: "composite" + steps: + - id: target + shell: bash + run: | + arch=$(uname -m) + target="${arch}-unknown-linux-gnu" + echo "target=${target}" >> $GITHUB_OUTPUT + + - uses: ./.github/actions/setup_bendsql + + - uses: ./.github/actions/artifact_download + with: + sha: ${{ github.sha }} + target: ${{ steps.target.outputs.target }} + category: full + artifacts: ${{ inputs.artifacts }} + path: ${{ inputs.path }} + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "11" + + - name: setup java env + shell: bash + run: | + echo "LD_LIBRARY_PATH=${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}" >> $GITHUB_ENV diff --git a/.github/actions/test_cloud_sqllogic_standalone_linux/action.yml b/.github/actions/test_cloud_sqllogic_standalone_linux/action.yml index e5cf50d872405..e7baa44beba81 100644 --- a/.github/actions/test_cloud_sqllogic_standalone_linux/action.yml +++ b/.github/actions/test_cloud_sqllogic_standalone_linux/action.yml @@ -1,16 +1,12 @@ name: "Test cloud control sqllogic Standalone" description: "Running cloud control sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true default: "" handlers: - description: "logic test handlers, mysql,http,clickhouse" + description: "logic test handlers, mysql,http" required: true default: "" storage-format: @@ -21,11 +17,8 @@ inputs: runs: using: "composite" steps: - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Run sqllogic Tests with Standalone mode diff --git a/.github/actions/test_compat_fuse/action.yml b/.github/actions/test_compat_fuse/action.yml index d93aa6da52a63..b1eb98bb9211b 100644 --- a/.github/actions/test_compat_fuse/action.yml +++ b/.github/actions/test_compat_fuse/action.yml @@ -1,19 +1,10 @@ name: "Test fuse-table format in an old query is compatible with new query" description: "Download old binaries and current binaries, write data with old query, read data with new query" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} path: ./bins/current artifacts: sqllogictests,meta,query diff --git a/.github/actions/test_compat_meta_meta/action.yml b/.github/actions/test_compat_meta_meta/action.yml index 72c44108af467..38d86b9188e46 100644 --- a/.github/actions/test_compat_meta_meta/action.yml +++ b/.github/actions/test_compat_meta_meta/action.yml @@ -1,18 +1,10 @@ name: "Test protocol compatibility between databend-meta servers" description: "Download old binaries and current binaries, write some data and then read data" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} path: ./bins/current/bin artifacts: meta,metactl,metabench diff --git a/.github/actions/test_compat_meta_query/action.yml b/.github/actions/test_compat_meta_query/action.yml index 0945fdfe3248f..0f9bc1e4d0962 100644 --- a/.github/actions/test_compat_meta_query/action.yml +++ b/.github/actions/test_compat_meta_query/action.yml @@ -1,18 +1,10 @@ name: "Test old metasrv is compatible with new query; new meta is compatible with old query" description: "Download old binaries and current binaries, run stateless test with old `meta` and latest `query`" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} path: ./bins/current artifacts: sqllogictests,meta,query diff --git a/.github/actions/test_ee_management_mode_linux/action.yml b/.github/actions/test_ee_management_mode_linux/action.yml index a94a4f7c22b72..8c5c9a9ae7323 100644 --- a/.github/actions/test_ee_management_mode_linux/action.yml +++ b/.github/actions/test_ee_management_mode_linux/action.yml @@ -1,19 +1,9 @@ name: "Test ee management mode" description: "Running stateless tests in management mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Run Stateful Tests with Standalone mode shell: bash diff --git a/.github/actions/test_ee_sqllogic_standalone_linux/action.yml b/.github/actions/test_ee_sqllogic_standalone_linux/action.yml index 4babb8cf9a1fa..7f680e9fd8657 100644 --- a/.github/actions/test_ee_sqllogic_standalone_linux/action.yml +++ b/.github/actions/test_ee_sqllogic_standalone_linux/action.yml @@ -1,16 +1,12 @@ name: "Test ee sqllogic Standalone" description: "Running ee sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true default: "" handlers: - description: "logic test handlers, mysql,http,clickhouse" + description: "logic test handlers, mysql,http" required: true default: "" storage-format: @@ -21,12 +17,8 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Run sqllogic Tests with Standalone mode diff --git a/.github/actions/test_ee_standalone_background_linux/action.yml b/.github/actions/test_ee_standalone_background_linux/action.yml index 53bd15130cd65..d58b5b66ecc54 100644 --- a/.github/actions/test_ee_standalone_background_linux/action.yml +++ b/.github/actions/test_ee_standalone_background_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Enterprise Background Service features Standalone" description: "Running stateless tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Minio Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_ee_standalone_fake_time_linux/action.yml b/.github/actions/test_ee_standalone_fake_time_linux/action.yml index 545956b97c09b..e8406b2b544e9 100644 --- a/.github/actions/test_ee_standalone_fake_time_linux/action.yml +++ b/.github/actions/test_ee_standalone_fake_time_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Enterprise features Standalone" description: "Running stateless tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Minio Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_ee_standalone_linux/action.yml b/.github/actions/test_ee_standalone_linux/action.yml index f033113b61d0a..6bae9ee1f5794 100644 --- a/.github/actions/test_ee_standalone_linux/action.yml +++ b/.github/actions/test_ee_standalone_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Enterprise features Standalone" description: "Running stateless tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Minio Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_fuzz_standalone_linux/action.yml b/.github/actions/test_fuzz_standalone_linux/action.yml index 855415e85f0d4..6913c54f04fef 100644 --- a/.github/actions/test_fuzz_standalone_linux/action.yml +++ b/.github/actions/test_fuzz_standalone_linux/action.yml @@ -1,20 +1,9 @@ name: "Test Fuzz Standalone" description: "Running fuzz tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Test setup shell: bash diff --git a/.github/actions/test_logs/action.yml b/.github/actions/test_logs/action.yml index a65bcf7b9c851..cb5461a2aee60 100644 --- a/.github/actions/test_logs/action.yml +++ b/.github/actions/test_logs/action.yml @@ -1,20 +1,9 @@ name: "Test collection query & profile logs for databend query" description: "Test collection query & profile logs for databend query" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} - artifacts: meta,query + - uses: ./.github/actions/setup_test - name: Run logging Tests shell: bash diff --git a/.github/actions/test_meta_cluster/action.yml b/.github/actions/test_meta_cluster/action.yml index 07248fbde1d80..d956eb28eb9dd 100644 --- a/.github/actions/test_meta_cluster/action.yml +++ b/.github/actions/test_meta_cluster/action.yml @@ -1,18 +1,9 @@ name: "Test databend-meta cluster" description: "Download binaries, setup cluster by joining and leaving" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Test databend-meta cluster shell: bash diff --git a/.github/actions/test_metactl/action.yml b/.github/actions/test_metactl/action.yml index 75c676019fb3d..84b8c68796305 100644 --- a/.github/actions/test_metactl/action.yml +++ b/.github/actions/test_metactl/action.yml @@ -1,18 +1,10 @@ name: "Test metactl" description: "" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: metactl,meta - name: Test metactl diff --git a/.github/actions/test_sqllogic_cluster_linux/action.yml b/.github/actions/test_sqllogic_cluster_linux/action.yml index df7894e54a4cc..f6ab46b79ac8e 100644 --- a/.github/actions/test_sqllogic_cluster_linux/action.yml +++ b/.github/actions/test_sqllogic_cluster_linux/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic Cluster Linux" description: "Running sqllogic tests in cluster mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true @@ -16,12 +12,8 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Run sqllogic Tests with Cluster mode diff --git a/.github/actions/test_sqllogic_iceberg_tpch/action.yml b/.github/actions/test_sqllogic_iceberg_tpch/action.yml index 760d5029acefb..125dd9e30f99b 100644 --- a/.github/actions/test_sqllogic_iceberg_tpch/action.yml +++ b/.github/actions/test_sqllogic_iceberg_tpch/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic iceberg tpch" description: "Running sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true @@ -16,13 +12,10 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query + - name: Iceberg Setup for (ubuntu-latest only) shell: bash run: | diff --git a/.github/actions/test_sqllogic_management_mode_linux/action.yml b/.github/actions/test_sqllogic_management_mode_linux/action.yml index 722aee7571703..d7bae6ce6079b 100644 --- a/.github/actions/test_sqllogic_management_mode_linux/action.yml +++ b/.github/actions/test_sqllogic_management_mode_linux/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic management mode" description: "Running sqllogic tests in management mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true @@ -16,12 +12,8 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Run sqllogic Tests with management mode diff --git a/.github/actions/test_sqllogic_stage/action.yml b/.github/actions/test_sqllogic_stage/action.yml index 4627eb9362321..3091e64949a42 100644 --- a/.github/actions/test_sqllogic_stage/action.yml +++ b/.github/actions/test_sqllogic_stage/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic Stage" description: "Running sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true @@ -20,13 +16,10 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query + - name: Minio Setup for (ubuntu-latest only) shell: bash run: | diff --git a/.github/actions/test_sqllogic_standalone_linux/action.yml b/.github/actions/test_sqllogic_standalone_linux/action.yml index 8293d68352530..1aa1f2080523b 100644 --- a/.github/actions/test_sqllogic_standalone_linux/action.yml +++ b/.github/actions/test_sqllogic_standalone_linux/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic Standalone" description: "Running sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true @@ -24,17 +20,13 @@ inputs: enable_table_meta_cache: description: "Enable table meta cache" required: false - default: true + default: "true" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Run sqllogic Tests with Standalone mode diff --git a/.github/actions/test_sqllogic_standalone_linux_minio/action.yml b/.github/actions/test_sqllogic_standalone_linux_minio/action.yml index 42cdb52e74fa4..39e4dcac3d113 100644 --- a/.github/actions/test_sqllogic_standalone_linux_minio/action.yml +++ b/.github/actions/test_sqllogic_standalone_linux_minio/action.yml @@ -1,16 +1,12 @@ name: "Test sqllogic Standalone(minio)" description: "Running sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" dirs: description: "logic test suites dirs" required: true default: "" handlers: - description: "logic test handlers, mysql,http,clickhouse" + description: "logic test handlers, mysql,http" required: true default: "" storage-format: @@ -21,12 +17,8 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query - name: Minio Setup for (ubuntu-latest only) @@ -45,6 +37,7 @@ runs: export AWS_EC2_METADATA_DISABLED=true aws --endpoint-url http://127.0.0.1:9900/ s3 mb s3://testbucket + aws --endpoint-url http://127.0.0.1:9900/ s3 mb s3://spillbucket - name: Run sqllogic Tests with Standalone mode if: inputs.storage-format == 'all' || inputs.storage-format == 'parquet' diff --git a/.github/actions/test_sqllogic_standalone_macos/action.yml b/.github/actions/test_sqllogic_standalone_macos/action.yml index a02d1404424e1..36bc985a8aaa7 100644 --- a/.github/actions/test_sqllogic_standalone_macos/action.yml +++ b/.github/actions/test_sqllogic_standalone_macos/action.yml @@ -1,10 +1,6 @@ name: "Test sqllogic Standalone" description: "Running sqllogic tests in standalone mode" inputs: - target: - description: "" - required: true - default: "x86_64-apple-darwin" dirs: description: "logic test suites dirs" required: true @@ -16,23 +12,22 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download + - uses: ./.github/actions/setup_test with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} artifacts: sqllogictests,meta,query + - name: Test setup shell: bash run: | bash ./scripts/setup/dev_setup.sh -yd + - name: Run sqllogic Tests with Standalone mode with embedded meta-store shell: bash env: TEST_HANDLERS: ${{ inputs.handlers }} run: | bash ./scripts/ci/ci-run-sqllogic-tests.sh ${{ inputs.dirs }} + - name: Upload failure if: failure() uses: ./.github/actions/artifact_failure diff --git a/.github/actions/test_stateful_cluster_linux/action.yml b/.github/actions/test_stateful_cluster_linux/action.yml index b012d26c4177c..6964d125f7907 100644 --- a/.github/actions/test_stateful_cluster_linux/action.yml +++ b/.github/actions/test_stateful_cluster_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Stateful Cluster Linux" description: "Running stateful tests in cluster mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Minio Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_stateful_hive_standalone/action.yml b/.github/actions/test_stateful_hive_standalone/action.yml index ad8ee0e62e004..13ff2579193aa 100644 --- a/.github/actions/test_stateful_hive_standalone/action.yml +++ b/.github/actions/test_stateful_hive_standalone/action.yml @@ -1,26 +1,9 @@ name: "(hive) Test Stateful Standalone" description: "(hive) Running stateful tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} - category: hdfs - - - name: Checkout java env - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: "11" + - uses: ./.github/actions/setup_test # hive cluster setup - name: Hive Cluster Setup diff --git a/.github/actions/test_stateful_iceberg_rest_standalone/action.yml b/.github/actions/test_stateful_iceberg_rest_standalone/action.yml index 14ccbe3f4cedf..5490e0ab00270 100644 --- a/.github/actions/test_stateful_iceberg_rest_standalone/action.yml +++ b/.github/actions/test_stateful_iceberg_rest_standalone/action.yml @@ -1,19 +1,9 @@ name: "Test Stateful Standalone Iceberg Rest" description: "Running Stateful Iceberg Rest tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Iceberg Rest Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_stateful_large_data/action.yml b/.github/actions/test_stateful_large_data/action.yml index 6ff3085984fa9..13348a44b25e3 100644 --- a/.github/actions/test_stateful_large_data/action.yml +++ b/.github/actions/test_stateful_large_data/action.yml @@ -1,20 +1,9 @@ name: "Test Stateful Large Data" description: "Running stateful with large data" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Run Stateful Tests with Standalone mode shell: bash diff --git a/.github/actions/test_stateful_standalone_linux/action.yml b/.github/actions/test_stateful_standalone_linux/action.yml index 211da8f3b73fc..90830bf3abd9a 100644 --- a/.github/actions/test_stateful_standalone_linux/action.yml +++ b/.github/actions/test_stateful_standalone_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Stateful Standalone Linux" description: "Running stateful tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Minio Setup for (ubuntu-latest only) shell: bash diff --git a/.github/actions/test_stateless_cluster_linux/action.yml b/.github/actions/test_stateless_cluster_linux/action.yml index b38de4913dae5..98bd2147ad77f 100644 --- a/.github/actions/test_stateless_cluster_linux/action.yml +++ b/.github/actions/test_stateless_cluster_linux/action.yml @@ -1,19 +1,9 @@ name: "Test Stateless Cluster Linux" description: "Running stateless tests in cluster mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Test setup shell: bash diff --git a/.github/actions/test_stateless_cluster_macos/action.yml b/.github/actions/test_stateless_cluster_macos/action.yml index 3bebc44f7d558..024106d5299c1 100644 --- a/.github/actions/test_stateless_cluster_macos/action.yml +++ b/.github/actions/test_stateless_cluster_macos/action.yml @@ -1,20 +1,10 @@ name: "Test Stateless Cluster MacOS" description: "Running stateless tests in cluster mode" -inputs: - target: - description: "" - required: true - default: "x86_64-apple-darwin" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql + - uses: ./.github/actions/setup_test - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} - name: Test setup shell: bash run: | diff --git a/.github/actions/test_stateless_standalone_linux/action.yml b/.github/actions/test_stateless_standalone_linux/action.yml index 8df0e11612ab0..09033cb945bf0 100644 --- a/.github/actions/test_stateless_standalone_linux/action.yml +++ b/.github/actions/test_stateless_standalone_linux/action.yml @@ -1,20 +1,9 @@ name: "Test Stateless Standalone" description: "Running stateless tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-unknown-linux-gnu" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Test setup shell: bash diff --git a/.github/actions/test_stateless_standalone_macos/action.yml b/.github/actions/test_stateless_standalone_macos/action.yml index 5b8a1d473e1f3..017ac3f6773d5 100644 --- a/.github/actions/test_stateless_standalone_macos/action.yml +++ b/.github/actions/test_stateless_standalone_macos/action.yml @@ -1,19 +1,9 @@ name: "Test Stateless Standalone" description: "Running stateless tests in standalone mode" -inputs: - target: - description: "" - required: true - default: "x86_64-apple-darwin" runs: using: "composite" steps: - - uses: ./.github/actions/setup_bendsql - - name: Download artifact - uses: ./.github/actions/artifact_download - with: - sha: ${{ github.sha }} - target: ${{ inputs.target }} + - uses: ./.github/actions/setup_test - name: Test setup shell: bash diff --git a/.github/scripts/bump_version.js b/.github/scripts/bump_version.js index 8c570e614d6b3..a77b8817b92c7 100644 --- a/.github/scripts/bump_version.js +++ b/.github/scripts/bump_version.js @@ -1,70 +1,214 @@ module.exports = async ({ github, context, core }) => { - const knownEvents = ["schedule", "workflow_dispatch", "release"]; + const knownEvents = ["schedule", "workflow_dispatch"]; if (!knownEvents.includes(context.eventName)) { core.setFailed(`Triggerd by unknown event: ${context.eventName}`); return; } - const { STABLE, TAG } = process.env; + const { TYPE, TAG } = process.env; - // trigger by release event - if (context.ref.startsWith("refs/tags/")) { - let tag = context.ref.replace("refs/tags/", ""); - core.setOutput("tag", tag); - core.setOutput("sha", context.sha); - core.info(`Tag event triggered by ${tag}.`); - return; + const RE_TAG_STABLE = /^v(\d+)\.(\d+)\.(\d+)$/; + const RE_TAG_NIGHTLY = /^v(\d+)\.(\d+)\.(\d+)-nightly$/; + const RE_TAG_PATCH = /^v(\d+)\.(\d+)\.(\d+)-p(\d+)$/; + + async function getPreviousNightlyRelease(github, context) { + const releases = await github.rest.repos.listReleases({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + for (const release of releases.data) { + const ret = RE_TAG_NIGHTLY.exec(release.tag_name); + if (ret) { + return release.tag_name; + } + } } - // trigger by schedule or workflow_dispatch event - if (STABLE == "true") { - if (TAG) { - // trigger stable release by workflow_dispatch with a tag - let result = /v(\d+)\.(\d+)\.(\d+)-nightly/g.exec(TAG); - if (result === null) { - core.setFailed(`The tag ${TAG} to stablize is invalid, ignoring`); - return; + function getNextNightlyRelease(previous) { + const nightly = RE_TAG_NIGHTLY.exec(previous); + if (nightly) { + const major = nightly[1]; + const minor = nightly[2]; + const patch = parseInt(nightly[3]) + 1; + return `v${major}.${minor}.${patch}-nightly`; + } + } + + async function getPreviousStableRelease(github, context) { + let page = 1; + while (true) { + const releases = await github.rest.repos.listReleases({ + owner: context.repo.owner, + repo: context.repo.repo, + page, + }); + if (releases.data.length === 0) { + break; + } + page++; + for (const release of releases.data) { + const ret = RE_TAG_STABLE.exec(release.tag_name); + if (ret) { + return release.tag_name; + } } - let major = result[1]; - let minor = result[2]; - let patch = result[3]; - let stable_tag = `v${major}.${minor}.${patch}`; - core.setOutput("tag", stable_tag); - let ref = await github.rest.git.getRef({ + } + } + + function getNextStableRelease() { + const nightly = RE_TAG_NIGHTLY.exec(TAG); + if (nightly) { + const major = nightly[1]; + const minor = nightly[2]; + const patch = nightly[3]; + return `v${major}.${minor}.${patch}`; + } + } + + async function getPreviousPatchRelease(github, context) { + let page = 1; + while (true) { + const releases = await github.rest.repos.listReleases({ owner: context.repo.owner, repo: context.repo.repo, - ref: `tags/${TAG}`, + page, }); - core.setOutput("sha", ref.data.object.sha); - core.info( - `Stable release ${stable_tag} from ${TAG} (${ref.data.object.sha})` - ); - } else { - core.setFailed("Stable release must be triggered with a nightly tag"); + if (releases.data.length === 0) { + break; + } + page++; + for (const release of releases.data) { + if (!release.tag_name.startsWith(TAG)) { + continue; + } + if (release.tag_name === TAG) { + // no previous patch release, use the previous stable release + return release.tag_name; + } + const ret = RE_TAG_PATCH.exec(release.tag_name); + if (!ret) { + core.warning(`Ignore invalid patch release ${release.tag_name}`); + continue; + } + return release.tag_name; + } + } + } + + function getNextPatchRelease(previous) { + const stable = RE_TAG_STABLE.exec(previous); + if (stable) { + const major = stable[1]; + const minor = stable[2]; + const patch = stable[3]; + return `v${major}.${minor}.${patch}-p1`; + } + const version = RE_TAG_PATCH.exec(previous); + if (version) { + const major = version[1]; + const minor = version[2]; + const patch = version[3]; + const pv = parseInt(version[4]) + 1; + return `v${major}.${minor}.${patch}-p${pv}`; + } + } + + switch (TYPE) { + case "": + case "nightly": { + core.setOutput("sha", context.sha); + core.info(`Nightly release triggered by (${context.sha})`); + + const previous = await getPreviousNightlyRelease(github, context); + if (!previous) { + core.setFailed(`No previous nightly release found, ignoring`); + return; + } + core.setOutput("previous", previous); + core.info(`Nightly release with previous release: ${previous}`); + + if (TAG) { + core.setOutput("tag", TAG); + core.info(`Release create manually with tag ${TAG}`); + return; + } + const nextTag = getNextNightlyRelease(previous); + if (!nextTag) { + core.setFailed(`No next nightly release from ${previous}`); + return; + } + core.setOutput("tag", nextTag); + core.info(`Release create new nightly ${nextTag}`); + return; + } + + case "stable": { + core.setOutput("sha", context.sha); + if (!TAG) { + core.setFailed("Stable release must be triggered with a nightly tag"); + return; + } + core.info(`Stable release triggered by ${TAG} (${context.sha})`); + const nextTag = getNextStableRelease(); + if (!nextTag) { + core.setFailed(`No stable release from ${TAG}`); + return; + } + core.setOutput("tag", nextTag); + core.info(`Stable release ${nextTag} from ${TAG}`); + + const previous = await getPreviousStableRelease(github, context); + if (!previous) { + core.setFailed(`No previous stable release found, ignoring`); + return; + } + core.setOutput("previous", previous); + core.info(`Stable release with previous release: ${previous}`); } - } else { - core.setOutput("sha", context.sha); - if (TAG) { - core.setOutput("tag", TAG); - core.info(`Release create manually with tag ${TAG} (${context.sha})`); - } else { - let releases = await github.rest.repos.listReleases({ + + case "patch": { + if (!TAG) { + core.setFailed("Patch release must be triggered with a stable tag"); + return; + } + core.info(`Patch release triggered by ${TAG}`); + const result = RE_TAG_STABLE.exec(TAG); + if (!result) { + core.setFailed(`The tag ${TAG} is invalid, ignoring`); + return; + } + + const branch = await github.rest.repos.getBranch({ owner: context.repo.owner, repo: context.repo.repo, - per_page: 1, + branch: `backport/${TAG}`, }); - let tag = releases.data[0].tag_name; - let result = /v(\d+)\.(\d+)\.(\d+)/g.exec(tag); - if (result === null) { - core.setFailed(`The previous tag ${tag} is invalid, ignoring`); + core.setOutput("sha", branch.data.commit.sha); + core.info( + `Patch release triggered by ${TAG} (${branch.data.commit.sha})` + ); + + const previous = await getPreviousPatchRelease(github, context); + if (!previous) { + core.setFailed(`No previous patch release found, ignoring`); return; } - let major = result[1]; - let minor = result[2]; - let patch = (parseInt(result[3]) + 1).toString(); - let next_tag = `v${major}.${minor}.${patch}-nightly`; - core.setOutput("tag", next_tag); - core.info(`Nightly release ${next_tag} from ${tag} (${context.sha})`); + core.setOutput("previous", previous); + core.info(`Patch release with previous release: ${previous}`); + + const nextTag = getNextPatchRelease(previous); + if (!nextTag) { + core.setFailed(`No next patch release from ${previous}`); + return; + } + core.setOutput("tag", nextTag); + core.info(`Patch release ${nextTag} from ${previous}`); + return; + } + + default: { + core.setFailed(`Unknown release type: ${TYPE}`); + return; } } }; diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 259574ece254a..59a627287ffe5 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -55,15 +55,6 @@ jobs: runner_provider: aws license_type: trial - # linux_hive: - # needs: changes - # if: needs.changes.outputs.any_src_changed == 'true' - # uses: ./.github/workflows/reuse.linux.hive.yml - # secrets: inherit - # with: - # build_profile: ci - # runner_provider: aws - ready: if: always() runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf488008b291f..39e14885662b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,16 +6,22 @@ on: workflow_dispatch: inputs: tag: - description: The tags to be released + description: | + The tags to be released. + Nightly release dose not require a tag. + Stable release requires a nightly version (v1.0.0-nightly). + Patch release requires a stable version (v1.0.0). required: false type: string - stable: - description: Make a stable release - required: false - type: boolean - release: - types: - - published + type: + description: Release type, default to nightly + required: true + type: choice + default: nightly + options: + - nightly + - stable + - patch permissions: id-token: write @@ -43,33 +49,33 @@ jobs: id: bump uses: actions/github-script@v7 env: - STABLE: "${{ inputs.stable }}" + TYPE: "${{ inputs.type }}" TAG: "${{ inputs.tag }}" with: script: | const script = require('./.github/scripts/bump_version.js') await script({ github, context, core }) - name: Create release - if: github.event_name == 'workflow_dispatch' env: # we need workflow:write permission to create release if there were any workflow changes # which is not possible for github actions token GH_TOKEN: ${{ secrets.DATABEND_BOT_TOKEN }} run: | - echo "Creating release ${{ steps.bump.outputs.tag }} from ${{ steps.bump.outputs.sha }}" - if [[ "${{ inputs.stable }}" == "true" ]]; then - previous=$(gh release list --limit 1 --exclude-pre-releases | cut -f 1) - echo "Stable release with previous release: $previous" - gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag $previous --latest --draft - else - previous=$(gh release list --limit 10 | grep nightly | head -n 1 | cut -f 1) - echo "Nightly release with previous release: $previous" - gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag $previous --prerelease --draft - fi + case "${{ inputs.type }}" in + nightly) + gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag ${{ steps.bump.outputs.previous }} --prerelease --draft + ;; + stable) + gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag ${{ steps.bump.outputs.previous }} --latest --draft + ;; + patch) + gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag ${{ steps.bump.outputs.previous }} --prerelease --draft + ;; + esac changelog: runs-on: ubuntu-latest - if: inputs.stable + if: inputs.type == 'stable' needs: create_release steps: - name: Checkout Docs @@ -281,16 +287,15 @@ jobs: REPO_DOCKERHUB: ${{ steps.login.outputs.dockerhub_repo }} REPO_ECR: ${{ steps.login.outputs.ecr_repo }} VERSION: ${{ needs.create_release.outputs.version }} - STABLE: ${{ inputs.stable }} + TYPE: ${{ inputs.type }} with: script: | - const version = process.env.VERSION; - const repos = [process.env.REPO_DOCKERHUB, process.env.REPO_ECR]; - const stable = process.env.STABLE; + const { VERSION, TYPE, REPO_DOCKERHUB, REPO_ECR } = process.env; + const repos = [REPO_DOCKERHUB, REPO_ECR]; let tags = []; for (const repo of repos) { - tags.push(`${repo}:${version}`); - if (stable === 'true') { + tags.push(`${repo}:${VERSION}`); + if (TYPE === 'stable') { tags.push(`${repo}:latest`); } else { tags.push(`${repo}:nightly`); @@ -362,16 +367,15 @@ jobs: REPO_DOCKERHUB: ${{ steps.login.outputs.dockerhub_repo }} REPO_ECR: ${{ steps.login.outputs.ecr_repo }} VERSION: ${{ needs.create_release.outputs.version }} - STABLE: ${{ inputs.stable }} + TYPE: ${{ inputs.type }} with: script: | - const version = process.env.VERSION; - const repos = [process.env.REPO_DOCKERHUB, process.env.REPO_ECR]; - const stable = process.env.STABLE; + const { VERSION, TYPE, REPO_DOCKERHUB, REPO_ECR } = process.env; + const repos = [REPO_DOCKERHUB, REPO_ECR]; let tags = []; for (const repo of repos) { - tags.push(`${repo}:${version}`); - if (stable === 'true') { + tags.push(`${repo}:${VERSION}`); + if (TYPE === 'stable') { tags.push(`${repo}:latest`); } else { tags.push(`${repo}:nightly`); @@ -410,7 +414,7 @@ jobs: packager: ${{ matrix.packager }} # bindings_python: - # if: inputs.stable + # if: inputs.type == 'stable' # needs: create_release # uses: ./.github/workflows/bindings.python.yml # secrets: inherit @@ -450,7 +454,7 @@ jobs: deb: runs-on: ubuntu-latest - if: inputs.stable + if: inputs.type == 'stable' needs: [create_release, distribution] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/reuse.linux.yml b/.github/workflows/reuse.linux.yml index 6909ac2cbe1f8..30bcd3d662fb9 100644 --- a/.github/workflows/reuse.linux.yml +++ b/.github/workflows/reuse.linux.yml @@ -41,39 +41,7 @@ jobs: - self-hosted - "${{ matrix.runner }}" - Linux - - 8c32g - - "${{ inputs.runner_provider }}" - strategy: - fail-fast: false - matrix: - include: - - { arch: x86_64, runner: X64 } - steps: - - uses: actions/checkout@v4 - with: - # fetch all tags, metasrv and metaclient need tag as its version. - fetch-depth: 0 - - uses: ./.github/actions/build_linux - timeout-minutes: 60 - env: - DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY: ${{ secrets.DATABEND_ENTERPRISE_LICENSE_PUBLIC_KEY }} - with: - sha: ${{ github.sha }} - target: ${{ matrix.arch }}-unknown-linux-gnu - artifacts: all - - name: upload sccache log - if: always() - uses: actions/upload-artifact@v4 - with: - name: sccache-build - path: target/sccache.log - - build_udf: - runs-on: - - self-hosted - - "${{ matrix.runner }}" - - Linux - - 8c32g + - 16c64g - "${{ inputs.runner_provider }}" strategy: fail-fast: false @@ -84,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - # fetch all tags, metasrv and metaclient need tag as its version. + # fetch all tags, metasrv and meta client need tag as its version. fetch-depth: 0 - uses: ./.github/actions/build_linux timeout-minutes: 60 @@ -93,14 +61,14 @@ jobs: with: sha: ${{ github.sha }} target: ${{ matrix.arch }}-unknown-linux-gnu - features: python-udf - category: udf - artifacts: query + features: python-udf,storage-hdfs + category: full + artifacts: all - name: upload sccache log if: always() uses: actions/upload-artifact@v4 with: - name: sccache-build-udf + name: sccache-build-${{ matrix.arch }} path: target/sccache.log # build_address_sanitizer: @@ -127,7 +95,7 @@ jobs: # artifacts: query test_unit: - runs-on: [self-hosted, X64, Linux, 8c32g, "${{ inputs.runner_provider }}"] + runs-on: [self-hosted, X64, Linux, 16c64g, "${{ inputs.runner_provider }}"] steps: - uses: actions/checkout@v4 with: @@ -256,6 +224,19 @@ jobs: with: name: test-stateful-iceberg-rest-standalone + test_stateful_hive_standalone: + needs: [build, check] + runs-on: [self-hosted, X64, Linux, 2c8g, "${{ inputs.runner_provider }}"] + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test_stateful_hive_standalone + timeout-minutes: 10 + - name: Upload failure + if: failure() + uses: ./.github/actions/artifact_failure + with: + name: test-stateful-iceberg-rest-standalone + # test_fuzz_standalone: # runs-on: [self-hosted, X64, Linux, 2c8g, "${{ inputs.runner_provider }}"] # needs: [build, check] diff --git a/.github/workflows/reuse.sqllogic.yml b/.github/workflows/reuse.sqllogic.yml index 0a834c7d0425c..dfd83da92df24 100644 --- a/.github/workflows/reuse.sqllogic.yml +++ b/.github/workflows/reuse.sqllogic.yml @@ -32,7 +32,7 @@ jobs: timeout-minutes: 10 with: dirs: management - handlers: mysql,http + handlers: http,mysql standalone: runs-on: @@ -54,7 +54,6 @@ jobs: - { dirs: "tpch", runner: "2c8g" } - { dirs: "standalone", runner: "2c8g" } handler: - - "mysql" - "http" steps: - uses: actions/checkout@v4 @@ -83,7 +82,7 @@ jobs: timeout-minutes: 15 with: dirs: udf_server - handlers: mysql,http + handlers: http parallel: 1 storage-format: all - name: Upload failure @@ -105,7 +104,7 @@ jobs: timeout-minutes: 15 with: dirs: task - handlers: mysql,http + handlers: http storage-format: all - name: Upload failure if: failure() || cancelled() @@ -121,7 +120,6 @@ jobs: dirs: - "query" handler: - - "mysql" - "http" format: - "native" @@ -152,7 +150,7 @@ jobs: timeout-minutes: 15 with: dirs: tpch_iceberg - handlers: mysql,http + handlers: http - name: Upload failure if: failure() uses: ./.github/actions/artifact_failure @@ -179,7 +177,6 @@ jobs: - { dirs: "tpch", runner: "2c8g" } - { dirs: "cluster", runner: "2c8g" } handler: - - "mysql" - "http" steps: - uses: actions/checkout@v4 @@ -213,7 +210,7 @@ jobs: with: storage: ${{ matrix.storage }} dirs: stage - handlers: mysql,http + handlers: http - name: Upload failure if: failure() uses: ./.github/actions/artifact_failure @@ -262,7 +259,7 @@ jobs: timeout-minutes: 15 with: dirs: ee - handlers: mysql,http + handlers: http storage-format: ${{ matrix.format }} - name: Upload failure if: failure() diff --git a/Cargo.lock b/Cargo.lock index aa6967e652341..be5c90ea48828 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -640,7 +640,7 @@ source = "git+https://github.com/datafuse-extras/async-backtrace.git?rev=dea4553 dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -728,7 +728,7 @@ source = "git+https://github.com/datafuse-extras/async-recursion.git?rev=a353334 dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -750,7 +750,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -767,7 +767,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -1419,7 +1419,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -1557,7 +1557,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "syn_derive", ] @@ -1709,7 +1709,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -2171,7 +2171,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -2851,7 +2851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -2894,7 +2894,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -2905,7 +2905,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5467,7 +5467,7 @@ checksum = "ec5c4fb5b59b1bd55ed8ebcf941f27a327d600c19a4a4103546846c358be93ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5616,7 +5616,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5626,7 +5626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5647,7 +5647,7 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "unicode-xid", ] @@ -5839,7 +5839,7 @@ dependencies = [ "enum-ordinalize 4.3.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5943,7 +5943,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5956,7 +5956,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5976,7 +5976,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -5988,7 +5988,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6009,7 +6009,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6075,7 +6075,7 @@ checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6227,7 +6227,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6483,7 +6483,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6495,7 +6495,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6507,7 +6507,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6605,7 +6605,7 @@ checksum = "5ac45ed0bddbd110eb68862768a194f88700f5b91c39931d2f432fab67a16d08" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -6670,7 +6670,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -7317,7 +7317,7 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -9829,7 +9829,7 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "termcolor", "thiserror", ] @@ -9847,7 +9847,7 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "termcolor", "thiserror", ] @@ -10065,7 +10065,7 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -10260,7 +10260,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -10315,9 +10315,9 @@ dependencies = [ [[package]] name = "object_store_opendal" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d37d6ca6cad56e446feab00d1378b0aae992f71bd9e04fe0454e8937ce1f9c9" +checksum = "b16689d68761f4fbe1700895e3d2aafbb22866e19830908ba155fa8e5fd33a35" dependencies = [ "async-trait", "bytes", @@ -10433,7 +10433,7 @@ dependencies = [ "proc-macro2", "quote", "semver", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -10475,7 +10475,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -10964,7 +10964,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11121,7 +11121,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11258,7 +11258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11358,7 +11358,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11369,9 +11369,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -11447,7 +11447,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11505,7 +11505,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.58", + "syn 2.0.96", "tempfile", ] @@ -11519,7 +11519,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11724,7 +11724,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11737,7 +11737,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -11973,7 +11973,7 @@ checksum = "8b86292cf41ccfc96c5de7165c1c53d5b4ac540c5bab9d1857acbe9eba5f1a0b" dependencies = [ "proc-macro-hack", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -12035,7 +12035,7 @@ version = "0.1.1" source = "git+https://github.com/datafuse-extras/recursive.git?rev=6af35a1#6af35a1e59e7050f86ee19fbd0a79535d016c87d" dependencies = [ "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -12172,9 +12172,9 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "reqsign" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03dd4ba7c3901dd43e6b8c7446a760d45bc1ea4301002e1a6fa48f97c3a796fa" +checksum = "eb0075a66c8bfbf4cc8b70dca166e722e1f55a3ea9250ecbb85f4d92a5f64149" dependencies = [ "anyhow", "async-trait", @@ -12947,7 +12947,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -12980,7 +12980,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -13050,7 +13050,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -13318,7 +13318,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -13554,7 +13554,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -13577,7 +13577,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.58", + "syn 2.0.96", "tempfile", "tokio", "url", @@ -13811,7 +13811,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -13967,9 +13967,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -13996,7 +13996,7 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14281,7 +14281,7 @@ checksum = "e71277381bd8b17eea2126a849dced540862c498398d4dd52405233a5d3cc643" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14301,7 +14301,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14451,7 +14451,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14646,7 +14646,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14728,7 +14728,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14874,7 +14874,7 @@ checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14885,7 +14885,7 @@ checksum = "560b82d656506509d43abe30e0ba64c56b1953ab3d4fe7ba5902747a7a3cedd5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -14921,7 +14921,7 @@ checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -15226,7 +15226,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -15380,7 +15380,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -15414,7 +15414,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15589,7 +15589,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -15705,7 +15705,7 @@ checksum = "df09be00c38f49172ca9936998938476e3f2df782673a39ae2ef9fb0838341b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] @@ -15839,7 +15839,7 @@ dependencies = [ "proc-macro2", "quote", "shellexpand", - "syn 2.0.58", + "syn 2.0.96", "witx", ] @@ -15851,7 +15851,7 @@ checksum = "9b8eb1a5783540696c59cefbfc9e52570c2d5e62bd47bdf0bdcef29231879db2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", "wiggle-generate", ] @@ -16345,7 +16345,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.96", ] [[package]] diff --git a/src/meta/app/src/principal/user_defined_function.rs b/src/meta/app/src/principal/user_defined_function.rs index 19b72cf57dc5b..d7d6493d531a6 100644 --- a/src/meta/app/src/principal/user_defined_function.rs +++ b/src/meta/app/src/principal/user_defined_function.rs @@ -65,6 +65,35 @@ pub enum UDFDefinition { UDAFScript(UDAFScript), } +impl UDFDefinition { + pub fn category(&self) -> &str { + match self { + Self::LambdaUDF(_) => "LambdaUDF", + Self::UDFServer(_) => "UDFServer", + Self::UDFScript(_) => "UDFScript", + Self::UDAFScript(_) => "UDAFScript", + } + } + + pub fn is_aggregate(&self) -> bool { + match self { + Self::LambdaUDF(_) => false, + Self::UDFServer(_) => false, + Self::UDFScript(_) => false, + Self::UDAFScript(_) => true, + } + } + + pub fn language(&self) -> &str { + match self { + Self::LambdaUDF(_) => "SQL", + Self::UDFServer(x) => x.language.as_str(), + Self::UDFScript(x) => x.language.as_str(), + Self::UDAFScript(x) => x.language.as_str(), + } + } +} + #[derive(Clone, Debug, Eq, PartialEq)] pub struct UserDefinedFunction { pub name: String, diff --git a/src/query/storages/system/src/user_functions_table.rs b/src/query/storages/system/src/user_functions_table.rs index 8ffb0d9b99d6a..77cad6b55adb9 100644 --- a/src/query/storages/system/src/user_functions_table.rs +++ b/src/query/storages/system/src/user_functions_table.rs @@ -106,6 +106,8 @@ pub struct UserFunctionArguments { arg_types: Vec, #[serde(skip_serializing_if = "std::option::Option::is_none")] return_type: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + server: Option, #[serde(skip_serializing_if = "std::vec::Vec::is_empty")] parameters: Vec, #[serde(skip_serializing_if = "std::collections::BTreeMap::is_empty")] @@ -118,6 +120,7 @@ pub struct UserFunction { is_aggregate: bool, description: String, language: String, + category: String, definition: String, created_on: DateTime, arguments: UserFunctionArguments, @@ -162,43 +165,39 @@ impl UserFunctionsTable { .into_iter() .map(|user_function| UserFunction { name: user_function.name, - is_aggregate: match user_function.definition { - UDFDefinition::LambdaUDF(_) => false, - UDFDefinition::UDFServer(_) | UDFDefinition::UDFScript(_) => false, - UDFDefinition::UDAFScript(_) => true, - }, + is_aggregate: user_function.definition.is_aggregate(), description: user_function.description, - language: match &user_function.definition { - UDFDefinition::LambdaUDF(_) => String::from("SQL"), - UDFDefinition::UDFServer(x) => x.language.clone(), - UDFDefinition::UDFScript(x) => x.language.to_string(), - UDFDefinition::UDAFScript(x) => x.language.to_string(), - }, + language: user_function.definition.language().to_string(), + category: user_function.definition.category().to_string(), definition: user_function.definition.to_string(), created_on: user_function.created_on, arguments: match &user_function.definition { UDFDefinition::LambdaUDF(x) => UserFunctionArguments { - return_type: None, arg_types: vec![], + return_type: None, + server: None, parameters: x.parameters.clone(), states: BTreeMap::new(), }, UDFDefinition::UDFServer(x) => UserFunctionArguments { - parameters: vec![], - return_type: Some(x.return_type.to_string()), arg_types: x.arg_types.iter().map(ToString::to_string).collect(), + return_type: Some(x.return_type.to_string()), + server: Some(x.address.to_string()), + parameters: vec![], states: BTreeMap::new(), }, UDFDefinition::UDFScript(x) => UserFunctionArguments { - parameters: vec![], - return_type: Some(x.return_type.to_string()), arg_types: x.arg_types.iter().map(ToString::to_string).collect(), + return_type: Some(x.return_type.to_string()), + server: None, + parameters: vec![], states: BTreeMap::new(), }, UDFDefinition::UDAFScript(x) => UserFunctionArguments { - parameters: vec![], - return_type: Some(x.return_type.to_string()), arg_types: x.arg_types.iter().map(ToString::to_string).collect(), + return_type: Some(x.return_type.to_string()), + server: None, + parameters: vec![], states: x .state_fields .iter() diff --git a/tests/suites/0_stateless/20+_others/20_0016_udf_timestamp.result b/tests/suites/0_stateless/20+_others/20_0016_udf_timestamp.result index ca3f9000a1b00..7265075dc2e46 100644 --- a/tests/suites/0_stateless/20+_others/20_0016_udf_timestamp.result +++ b/tests/suites/0_stateless/20+_others/20_0016_udf_timestamp.result @@ -1,6 +1,6 @@ ==TEST SHOW USER FUNCTIONS== isnotempty 0 {"parameters":["p"]} SQL yyyy-mm-dd HH:MM:SS.ssssss -ping 0 Built-in UDF {"arg_types":["String NULL"],"return_type":"String NULL"} python yyyy-mm-dd HH:MM:SS.ssssss +ping 0 Built-in UDF {"arg_types":["String NULL"],"return_type":"String NULL","server":"http://0.0.0.0:8815"} python yyyy-mm-dd HH:MM:SS.ssssss ==TEST SELECT * FROM SYSTEM.USER_FUNCTIONS== isnotempty 0 {"parameters":["p"]} SQL (p) -> NOT is_null(p) yyyy-mm-dd HH:MM:SS.ssssss -ping 0 Built-in UDF {"arg_types":["String NULL"],"return_type":"String NULL"} python (String NULL) RETURNS String NULL LANGUAGE python HANDLER = ping ADDRESS = http://0.0.0.0:8815 yyyy-mm-dd HH:MM:SS.ssssss +ping 0 Built-in UDF {"arg_types":["String NULL"],"return_type":"String NULL","server":"http://0.0.0.0:8815"} python (String NULL) RETURNS String NULL LANGUAGE python HANDLER = ping ADDRESS = http://0.0.0.0:8815 yyyy-mm-dd HH:MM:SS.ssssss diff --git a/tests/suites/5_ee/00_check/00_0014_license_info.py b/tests/suites/5_ee/00_check/00_0014_license_info.py index 6d658540ed664..73c13d801cba4 100755 --- a/tests/suites/5_ee/00_check/00_0014_license_info.py +++ b/tests/suites/5_ee/00_check/00_0014_license_info.py @@ -49,7 +49,7 @@ def get_license(): issue_at = license[0][3] expire_at = license[0][4] features = license[0][6] - now = datetime.utcnow() + now = datetime.now() if now < issue_at or now > expire_at: print(