diff --git a/Cargo.lock b/Cargo.lock index ec72dd2cad577..1f60a6052a4dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3887,16 +3887,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" -[[package]] -name = "fancy-regex" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" -dependencies = [ - "bit-set", - "regex", -] - [[package]] name = "fancy-regex" version = "0.13.0" @@ -8314,9 +8304,9 @@ dependencies = [ [[package]] name = "rdkafka-sys" -version = "4.6.0+2.2.0" +version = "4.7.0+2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad63c279fca41a27c231c450a2d2ad18288032e9cbb159ad16c9d96eba35aaaf" +checksum = "55e0d2f9ba6253f6ec72385e453294f8618e9e15c2c6aba2a5c01ccf9622d615" dependencies = [ "cmake", "libc", @@ -8844,6 +8834,7 @@ dependencies = [ "risingwave_compactor", "risingwave_compute", "risingwave_ctl", + "risingwave_expr", "risingwave_expr_impl", "risingwave_frontend", "risingwave_meta_node", @@ -9369,7 +9360,7 @@ dependencies = [ "chrono-tz", "criterion", "expect-test", - "fancy-regex 0.13.0", + "fancy-regex", "futures-async-stream", "futures-util", "hex", @@ -9431,7 +9422,7 @@ dependencies = [ "educe 0.5.7", "either", "enum-as-inner", - "fancy-regex 0.11.0", + "fancy-regex", "fixedbitset", "futures", "futures-async-stream", @@ -13980,7 +13971,6 @@ dependencies = [ "axum", "base64 0.21.4", "bigdecimal 0.4.2", - "bit-set", "bit-vec", "bitflags 2.4.0", "byteorder", diff --git a/Makefile.toml b/Makefile.toml index 8820acf67c7bd..2055eab88cdc0 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -35,6 +35,7 @@ is_release = get_env ENABLE_RELEASE_PROFILE is_not_release = not ${is_release} is_dynamic_linking = get_env ENABLE_DYNAMIC_LINKING is_hummock_trace = get_env ENABLE_HUMMOCK_TRACE +is_python_udf_enabled = get_env ENABLE_PYTHON_UDF if ${is_sanitizer_enabled} set_env RISEDEV_CARGO_BUILD_EXTRA_ARGS "-Zbuild-std --target ${CARGO_MAKE_RUST_TARGET_TRIPLE}" @@ -65,6 +66,11 @@ else set_env RISINGWAVE_FEATURE_FLAGS "--features rw-static-link" end +if ${is_python_udf_enabled} + flags = get_env RISINGWAVE_FEATURE_FLAGS + set_env RISINGWAVE_FEATURE_FLAGS "${flags} --features embedded-python-udf" +end + if ${is_hummock_trace} set_env BUILD_HUMMOCK_TRACE_CMD "-p risingwave_storage --features hm-trace" else @@ -621,6 +627,25 @@ if [ ! -f "${RC_ENV_FILE}" ]; then fi ''' +[tasks.psql-env] +category = "RiseDev - Start/Stop" +description = "Dump env configuration for psql" +dependencies = ["check-risedev-env-file"] +env_files = ["${PREFIX_CONFIG}/risedev-env"] +script = ''' +#!/usr/bin/env bash +cat < "${PREFIX_CONFIG}/psql-env" +export PGHOST=$RW_FRONTEND_LISTEN_ADDRESS +export PGPORT=$RW_FRONTEND_PORT +export PGUSER=root +export PGDATABASE=dev +EOF + +echo "psql environment file is created at ${PREFIX_CONFIG}/psql-env" +echo "You can source this file to use psql with default connection parameters." +echo " $(tput setaf 4)source ${PREFIX_CONFIG}/psql-env$(tput sgr0)" +''' + [tasks.psql] category = "RiseDev - Start/Stop" description = "Run local psql client with default connection parameters. You can pass extra arguments to psql." diff --git a/backwards-compat-tests/scripts/utils.sh b/backwards-compat-tests/scripts/utils.sh index 5990aac026077..3bbd9b06ca42c 100644 --- a/backwards-compat-tests/scripts/utils.sh +++ b/backwards-compat-tests/scripts/utils.sh @@ -49,6 +49,23 @@ kill_zookeeper() { wait_zookeeper_exit } +wait_for_process() { + process_name="$1" + + while pgrep -x "$process_name" > /dev/null; do + echo "Process $process_name is still running... Wait for 1 sec" + sleep 1 + done +} + +wait_all_process_exit() { + wait_for_process meta-node + wait_for_process compute-node + wait_for_process frontend + wait_for_process compactor + echo "All processes has exited." +} + # Older versions of RW may not gracefully kill kafka. # So we duplicate the definition here. kill_cluster() { @@ -75,6 +92,7 @@ kill_cluster() { tmux kill-session -t risedev test $? -eq 0 || { echo "Failed to stop all RiseDev components."; exit 1; } + wait_all_process_exit } run_sql () { diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 852f9afc4deb8..829aaf2dd0a65 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -96,18 +96,6 @@ services: volumes: - ..:/risingwave - sink-doris-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20231109 - depends_on: - - doris-fe-server - - doris-be-server - volumes: - - ..:/risingwave - command: > - sh -c "sudo sysctl -w vm.max_map_count=2000000" - networks: - mynetwork: - ipv4_address: 172.121.0.4 rw-build-env: image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240223 @@ -189,39 +177,6 @@ services: timeout: 30s retries: 50 - doris-fe-server: - platform: linux/amd64 - image: apache/doris:2.0.0_alpha-fe-x86_64 - hostname: doris-fe-server - command: > - sh -c "sudo sysctl -w vm.max_map_count=2000000" - environment: - - FE_SERVERS=fe1:172.121.0.2:9010 - - FE_ID=1 - ports: - - "8030:8030" - - "9030:9030" - networks: - mynetwork: - ipv4_address: 172.121.0.2 - - doris-be-server: - platform: linux/amd64 - image: apache/doris:2.0.0_alpha-be-x86_64 - hostname: doris-be-server - command: > - sh -c "sudo sysctl -w vm.max_map_count=2000000" - environment: - - FE_SERVERS=fe1:172.121.0.2:9010 - - BE_ADDR=172.121.0.3:9050 - depends_on: - - doris-fe-server - ports: - - "9050:9050" - networks: - mynetwork: - ipv4_address: 172.121.0.3 - cassandra-server: container_name: cassandra-server image: cassandra:4.0 @@ -319,9 +274,3 @@ services: interval: 5s timeout: 5s retries: 5 -networks: - mynetwork: - ipam: - config: - - subnet: 172.121.80.0/16 - default: diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index 5fed2cfeedf1b..91b26bee8d383 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -53,6 +53,7 @@ cargo build \ -p risingwave_compaction_test \ -p risingwave_e2e_extended_mode_test \ $RISINGWAVE_FEATURE_FLAGS \ + --features embedded-python-udf \ --profile "$profile" diff --git a/ci/workflows/main-cron.yml b/ci/workflows/main-cron.yml index 15d9733fa3856..d7bb61744795d 100644 --- a/ci/workflows/main-cron.yml +++ b/ci/workflows/main-cron.yml @@ -834,36 +834,37 @@ steps: timeout_in_minutes: 10 retry: *auto-retry - - label: "set vm_max_map_count_2000000" - key: "set-vm_max_map_count" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" - || build.env("CI_STEPS") =~ /(^|,)e2e-doris-sink-tests?(,|$$)/ - command: "sudo sysctl -w vm.max_map_count=2000000" - depends_on: - - "build" - - "build-other" + # Causes ci error, close it first, fix it later + # - label: "set vm_max_map_count_2000000" + # key: "set-vm_max_map_count" + # if: | + # !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null + # || build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" + # || build.env("CI_STEPS") =~ /(^|,)e2e-doris-sink-tests?(,|$$)/ + # command: "sudo sysctl -w vm.max_map_count=2000000" + # depends_on: + # - "build" + # - "build-other" - - label: "end-to-end doris sink test" - key: "e2e-doris-sink-tests" - command: "ci/scripts/e2e-doris-sink-test.sh -p ci-release" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" - || build.env("CI_STEPS") =~ /(^|,)e2e-doris-sink-tests?(,|$$)/ - depends_on: - - "build" - - "build-other" - - "set-vm_max_map_count" - plugins: - - docker-compose#v5.1.0: - run: sink-doris-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 10 - retry: *auto-retry + # - label: "end-to-end doris sink test" + # key: "e2e-doris-sink-tests" + # command: "ci/scripts/e2e-doris-sink-test.sh -p ci-release" + # if: | + # !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null + # || build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" + # || build.env("CI_STEPS") =~ /(^|,)e2e-doris-sink-tests?(,|$$)/ + # depends_on: + # - "build" + # - "build-other" + # - "set-vm_max_map_count" + # plugins: + # - docker-compose#v5.1.0: + # run: sink-doris-env + # config: ci/docker-compose.yml + # mount-buildkite-agent: true + # - ./ci/plugins/upload-failure-logs + # timeout_in_minutes: 10 + # retry: *auto-retry - label: "end-to-end starrocks sink test" key: "e2e-starrocks-sink-tests" diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 04961b3838bd9..eeef7f523f3c2 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -96,7 +96,7 @@ steps: config: ci/docker-compose.yml mount-buildkite-agent: true - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 17 + timeout_in_minutes: 18 retry: *auto-retry - label: "end-to-end test (parallel)" @@ -307,29 +307,30 @@ steps: timeout_in_minutes: 10 retry: *auto-retry - - label: "set vm_max_map_count_2000000" - key: "set-vm_max_map_count" - if: build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" || build.env("CI_STEPS") =~ /(^|,) e2e-doris-sink-tests?(,|$$)/ - command: "sudo sysctl -w vm.max_map_count=2000000" - depends_on: - - "build" - - "build-other" - - - label: "end-to-end doris sink test" - if: build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" || build.env("CI_STEPS") =~ /(^|,) e2e-doris-sink-tests?(,|$$)/ - command: "ci/scripts/e2e-doris-sink-test.sh -p ci-dev" - depends_on: - - "build" - - "build-other" - - "set-vm_max_map_count" - plugins: - - docker-compose#v5.1.0: - run: sink-doris-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 10 - retry: *auto-retry + # Causes ci error, close it first, fix it later + # - label: "set vm_max_map_count_2000000" + # key: "set-vm_max_map_count" + # if: build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" || build.env("CI_STEPS") =~ /(^|,) e2e-doris-sink-tests?(,|$$)/ + # command: "sudo sysctl -w vm.max_map_count=2000000" + # depends_on: + # - "build" + # - "build-other" + + # - label: "end-to-end doris sink test" + # if: build.pull_request.labels includes "ci/run-e2e-doris-sink-tests" || build.env("CI_STEPS") =~ /(^|,) e2e-doris-sink-tests?(,|$$)/ + # command: "ci/scripts/e2e-doris-sink-test.sh -p ci-dev" + # depends_on: + # - "build" + # - "build-other" + # - "set-vm_max_map_count" + # plugins: + # - docker-compose#v5.1.0: + # run: sink-doris-env + # config: ci/docker-compose.yml + # mount-buildkite-agent: true + # - ./ci/plugins/upload-failure-logs + # timeout_in_minutes: 10 + # retry: *auto-retry - label: "end-to-end starrocks sink test" if: build.pull_request.labels includes "ci/run-e2e-starrocks-sink-tests" || build.env("CI_STEPS") =~ /(^|,) e2e-starrocks-sink-tests?(,|$$)/ diff --git a/docker/Dockerfile b/docker/Dockerfile index ed24e05ede2d2..d42dc74da3f11 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,6 +5,13 @@ ENV LANG en_US.utf8 RUN apt-get update \ && apt-get -y install ca-certificates build-essential libsasl2-dev openjdk-11-jdk +# Install Python 3.12 +RUN apt-get -y install software-properties-common +RUN add-apt-repository ppa:deadsnakes/ppa -y && \ + apt-get update -yy && \ + DEBIAN_FRONTEND=noninteractive apt-get install python3.12 python3.12-dev -yy +ENV PYO3_PYTHON=python3.12 + FROM base AS dashboard-builder RUN apt-get update && apt-get install -y curl gnupg protobuf-compiler && mkdir -p /etc/apt/keyrings \ @@ -70,7 +77,7 @@ COPY ./ /risingwave WORKDIR /risingwave RUN cargo fetch && \ - cargo build -p risingwave_cmd_all --release --features "rw-static-link" && \ + cargo build -p risingwave_cmd_all --release --features "rw-static-link" --features embedded-python-udf && \ mkdir -p /risingwave/bin && \ mv /risingwave/target/release/risingwave /risingwave/bin/ && \ mv /risingwave/target/release/risingwave.dwp /risingwave/bin/ && \ diff --git a/docker/Dockerfile.hdfs b/docker/Dockerfile.hdfs index 98cb5a566d92f..28859a453c9a1 100644 --- a/docker/Dockerfile.hdfs +++ b/docker/Dockerfile.hdfs @@ -5,6 +5,13 @@ ENV LANG en_US.utf8 RUN apt-get update \ && apt-get -y install ca-certificates build-essential libsasl2-dev openjdk-11-jdk +# Install Python 3.12 +RUN apt-get -y install software-properties-common +RUN add-apt-repository ppa:deadsnakes/ppa -y && \ + apt-get update -yy && \ + DEBIAN_FRONTEND=noninteractive apt-get install python3.12 python3.12-dev -yy +ENV PYO3_PYTHON=python3.12 + FROM base AS builder RUN apt-get update && apt-get -y install make cmake protobuf-compiler curl bash lld maven unzip @@ -45,7 +52,7 @@ ENV JAVA_HOME ${JAVA_HOME_PATH} ENV LD_LIBRARY_PATH ${JAVA_HOME_PATH}/lib/server:${LD_LIBRARY_PATH} RUN cargo fetch && \ - cargo build -p risingwave_cmd_all --release -p risingwave_object_store --features hdfs-backend --features "rw-static-link" && \ + cargo build -p risingwave_cmd_all --release -p risingwave_object_store --features hdfs-backend --features "rw-static-link" --features embedded-python-udf && \ mkdir -p /risingwave/bin && \ mv /risingwave/target/release/risingwave /risingwave/bin/ && \ mv /risingwave/target/release/risingwave.dwp /risingwave/bin/ && \ diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 81e9aae0048bb..8cf5dcd4ebbaa 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -75,6 +75,7 @@ RiseDev is the development mode of RisingWave. To develop RisingWave, you need t * PostgreSQL (psql) (>= 14.1) * Tmux (>= v3.2a) * LLVM 16 (For macOS only, to workaround some bugs in macOS toolchain. See https://github.com/risingwavelabs/risingwave/issues/6205) +* Python (>= 3.12) (Optional, only required by `embedded-python-udf` feature) To install the dependencies on macOS, run: @@ -96,6 +97,31 @@ Then you'll be able to compile and start RiseDev! > > `.cargo/config.toml` contains `rustflags` configurations like `-Clink-arg` and `-Ctarget-feature`. Since it will be [merged](https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure) with `$HOME/.cargo/config.toml`, check the config files and make sure they don't conflict if you have global `rustflags` configurations for e.g. linker there. +> [!INFO] +> +> If you want to build RisingWave with `embedded-python-udf` feature, you need to install Python 3.12. +> +> To install Python 3.12 on macOS, run: +> +> ```shell +> brew install python@3.12 +> ``` +> +> To install Python 3.12 on Debian-based Linux systems, run: +> +> ```shell +> sudo apt install software-properties-common +> sudo add-apt-repository ppa:deadsnakes/ppa +> sudo apt-get update +> sudo apt-get install python3.12 python3.12-dev +> ``` +> +> If the default `python3` version is not 3.12, please set the `PYO3_PYTHON` environment variable: +> +> ```shell +> export PYO3_PYTHON=python3.12 +> ``` + ## Start and monitor a dev cluster You can now build RiseDev and start a dev cluster. It is as simple as: diff --git a/e2e_test/streaming/bug_fixes/issue_15075.slt b/e2e_test/streaming/bug_fixes/issue_15075.slt new file mode 100644 index 0000000000000..86d79e6f439a6 --- /dev/null +++ b/e2e_test/streaming/bug_fixes/issue_15075.slt @@ -0,0 +1,58 @@ +# https://github.com/risingwavelabs/risingwave/issues/15074 +# https://github.com/risingwavelabs/risingwave/issues/15075 + +statement ok +CREATE TABLE t1 ( + c1 varchar, + c2 varchar, + c3 bigint, + c4 numeric, + c5 timestamptz +) APPEND ONLY; + +statement ok +CREATE TABLE t2 ( + c6 timestamptz, + c7 integer, + c8 integer, + c9 integer, + c10 varchar, + c11 numeric, + c12 numeric, + c2 varchar +); + +statement ok +CREATE MATERIALIZED VIEW mv1 AS +SELECT + o.*, + b.c13, + b.c14 +FROM + t2 o + LEFT JOIN LATERAL ( + SELECT + sum(t.c3 * t.c4) filter ( + WHERE + (o.c11) * t.c4 <= (o.c11) * o.c12 + ) AS c13, + sum(t.c3) filter ( + WHERE + (o.c11) * t.c4 <= (o.c11) * o.c12 + ) AS c14 + FROM + t1 t + WHERE + t.c2 = o.c2 + AND t.c5 >= o.c6 + AND t.c5 :: date = o.c6 :: date + ) AS b ON TRUE; + +statement ok +drop materialized view mv1; + +statement ok +drop table t1; + +statement ok +drop table t2; diff --git a/e2e_test/udf/sql_udf.slt b/e2e_test/udf/sql_udf.slt index ed1a5ea327003..866f27abd52ce 100644 --- a/e2e_test/udf/sql_udf.slt +++ b/e2e_test/udf/sql_udf.slt @@ -332,12 +332,49 @@ In SQL UDF definition: `select i_am_valid + _this_is_invalid_please_properly_mar ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# sql udf with non-existent function +statement error +create function call_non_existent_function(INT) returns int language sql as 'select 1 + non_existent(1) + 1'; +---- +db error: ERROR: Failed to run the query + +Caused by: + Invalid input syntax: Failed to conduct semantic check +function non_existent(integer) does not exist +In SQL UDF definition: `select 1 + non_existent(1) + 1` + ^^^^^^^^^^^^ + + +# First display invalid parameter +# if not found, try displaying non-existent functions +# if still not found, display default error message without hint +statement error +create function param_func_mix(a INT, b INT) returns int language sql as 'select a + b + c + not_be_displayed(c)'; +---- +db error: ERROR: Failed to run the query + +Caused by: + Invalid input syntax: Failed to conduct semantic check +Bind error: [sql udf] failed to find named parameter c +In SQL UDF definition: `select a + b + c + not_be_displayed(c)` + ^ + + statement error Expected end of statement, found: 💩 create function call_regexp_replace() returns varchar language sql as 'select regexp_replace('💩💩💩💩💩foo🤔️bar亲爱的😭baz这不是爱情❤️‍🔥', 'baz(...)', '这是🥵', 'ic')'; # Recursive definition can NOT be accepted at present due to semantic check -statement error Failed to conduct semantic check +statement error create function recursive(INT, INT) returns int language sql as 'select recursive($1, $2) + recursive($1, $2)'; +---- +db error: ERROR: Failed to run the query + +Caused by: + Invalid input syntax: Failed to conduct semantic check +function recursive(integer, integer) does not exist +In SQL UDF definition: `select recursive($1, $2) + recursive($1, $2)` + ^^^^^^^^^ + # Complex but error-prone definition, recursive & normal sql udfs interleaving statement error Failed to conduct semantic check diff --git a/java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java b/java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java index f8a63971b95e4..7014c3adb92da 100644 --- a/java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java +++ b/java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java @@ -42,7 +42,7 @@ public class PostgresValidator extends DatabaseValidator implements AutoCloseabl private final boolean pubAutoCreate; - private static final String AWS_RDS_HOST = "rds.amazonaws.com"; + private static final String AWS_RDS_HOST = "amazonaws.com"; private final boolean isAwsRds; // Whether the properties to validate is shared by multiple tables. diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index c5f193ef8a2a3..813928ce931ea 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -10,6 +10,7 @@ repository = { workspace = true } [features] rw-static-link = ["workspace-config/rw-static-link"] rw-dynamic-link = ["workspace-config/rw-dynamic-link"] +embedded-python-udf = ["risingwave_expr/embedded-python-udf"] default = ["rw-static-link"] [package.metadata.cargo-machete] @@ -30,6 +31,7 @@ risingwave_common = { workspace = true } risingwave_compactor = { workspace = true } risingwave_compute = { workspace = true } risingwave_ctl = { workspace = true } +risingwave_expr = { workspace = true } risingwave_expr_impl = { workspace = true } risingwave_frontend = { workspace = true } risingwave_meta_node = { workspace = true } diff --git a/src/expr/core/Cargo.toml b/src/expr/core/Cargo.toml index e4eb82966b038..03ed84ac6a216 100644 --- a/src/expr/core/Cargo.toml +++ b/src/expr/core/Cargo.toml @@ -15,12 +15,15 @@ ignored = ["workspace-hack", "ctor"] [package.metadata.cargo-udeps.ignore] normal = ["workspace-hack", "ctor"] +[features] +embedded-python-udf = ["arrow-udf-python"] + [dependencies] anyhow = "1" arrow-array = { workspace = true } arrow-schema = { workspace = true } arrow-udf-js = { workspace = true } -arrow-udf-python = { workspace = true } +arrow-udf-python = { workspace = true, optional = true } arrow-udf-wasm = { workspace = true } async-trait = "0.1" auto_impl = "1" diff --git a/src/expr/core/src/expr/expr_udf.rs b/src/expr/core/src/expr/expr_udf.rs index c3d5193efb617..7acd4307b71f3 100644 --- a/src/expr/core/src/expr/expr_udf.rs +++ b/src/expr/core/src/expr/expr_udf.rs @@ -21,6 +21,7 @@ use std::time::Duration; use anyhow::Context; use arrow_schema::{Field, Fields, Schema}; use arrow_udf_js::{CallMode as JsCallMode, Runtime as JsRuntime}; +#[cfg(feature = "embedded-python-udf")] use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; use arrow_udf_wasm::Runtime as WasmRuntime; use await_tree::InstrumentAwait; @@ -60,10 +61,11 @@ pub struct UserDefinedFunction { const INITIAL_RETRY_COUNT: u8 = 16; #[derive(Debug)] -enum UdfImpl { +pub enum UdfImpl { External(Arc), Wasm(Arc), JavaScript(JsRuntime), + #[cfg(feature = "embedded-python-udf")] Python(PythonRuntime), } @@ -110,6 +112,7 @@ impl UserDefinedFunction { let arrow_output: arrow_array::RecordBatch = match &self.imp { UdfImpl::Wasm(runtime) => runtime.call(&self.identifier, &arrow_input)?, UdfImpl::JavaScript(runtime) => runtime.call(&self.identifier, &arrow_input)?, + #[cfg(feature = "embedded-python-udf")] UdfImpl::Python(runtime) => runtime.call(&self.identifier, &arrow_input)?, UdfImpl::External(client) => { let disable_retry_count = self.disable_retry_count.load(Ordering::Relaxed); @@ -210,6 +213,7 @@ impl Build for UserDefinedFunction { )?; UdfImpl::JavaScript(rt) } + #[cfg(feature = "embedded-python-udf")] "python" if udf.body.is_some() => { let mut rt = PythonRuntime::builder().sandboxed(true).build()?; let body = udf.get_body()?; diff --git a/src/expr/core/src/table_function/user_defined.rs b/src/expr/core/src/table_function/user_defined.rs index 9efd7997b512a..0d1d726c394c7 100644 --- a/src/expr/core/src/table_function/user_defined.rs +++ b/src/expr/core/src/table_function/user_defined.rs @@ -18,16 +18,16 @@ use anyhow::Context; use arrow_array::RecordBatch; use arrow_schema::{Field, Fields, Schema, SchemaRef}; use arrow_udf_js::{CallMode as JsCallMode, Runtime as JsRuntime}; +#[cfg(feature = "embedded-python-udf")] use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; -use arrow_udf_wasm::Runtime as WasmRuntime; use cfg_or_panic::cfg_or_panic; use futures_util::stream; use risingwave_common::array::{ArrayError, DataChunk, I32Array}; use risingwave_common::bail; -use risingwave_udf::ArrowFlightUdfClient; use thiserror_ext::AsReport; use super::*; +use crate::expr::expr_udf::UdfImpl; #[derive(Debug)] pub struct UserDefinedTableFunction { @@ -41,14 +41,6 @@ pub struct UserDefinedTableFunction { chunk_size: usize, } -#[derive(Debug)] -enum UdfImpl { - External(Arc), - Wasm(Arc), - JavaScript(JsRuntime), - Python(PythonRuntime), -} - #[async_trait::async_trait] impl TableFunction for UserDefinedTableFunction { fn return_type(&self) -> DataType { @@ -80,6 +72,7 @@ impl UdfImpl { yield res?; } } + #[cfg(feature = "embedded-python-udf")] UdfImpl::Python(runtime) => { for res in runtime.call_table_function(identifier, &input, 1024)? { yield res?; @@ -219,6 +212,7 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { let mut rt = PythonRuntime::builder().sandboxed(true).build()?; let body = udtf.get_body()?; diff --git a/src/frontend/Cargo.toml b/src/frontend/Cargo.toml index dc6bc8d84d294..53ece7967f189 100644 --- a/src/frontend/Cargo.toml +++ b/src/frontend/Cargo.toml @@ -33,7 +33,7 @@ easy-ext = "1" educe = "0.5" either = "1" enum-as-inner = "0.6" -fancy-regex = "0.11.0" +fancy-regex = "0.13.0" fixedbitset = "0.4.2" futures = { version = "0.3", default-features = false, features = ["alloc"] } futures-async-stream = { workspace = true } diff --git a/src/frontend/src/binder/bind_param.rs b/src/frontend/src/binder/bind_param.rs index 9d51947b35063..df22fada66559 100644 --- a/src/frontend/src/binder/bind_param.rs +++ b/src/frontend/src/binder/bind_param.rs @@ -65,6 +65,11 @@ impl ExprRewriter for ParamRewriter { } } + fn rewrite_subquery(&mut self, mut subquery: crate::expr::Subquery) -> ExprImpl { + subquery.query.rewrite_exprs_recursive(self); + subquery.into() + } + fn rewrite_parameter(&mut self, parameter: crate::expr::Parameter) -> ExprImpl { let data_type = parameter.return_type(); @@ -224,4 +229,17 @@ mod test { ), ); } + + #[tokio::test] + async fn subquery() { + expect_actual_eq( + create_expect_bound("select (select '1')"), + create_actual_bound( + "select (select $1)", + vec![], + vec![Some("1".into())], + vec![Format::Text], + ), + ); + } } diff --git a/src/frontend/src/handler/create_sql_function.rs b/src/frontend/src/handler/create_sql_function.rs index 3889c8c22e7f8..f4c683b4d7a0e 100644 --- a/src/frontend/src/handler/create_sql_function.rs +++ b/src/frontend/src/handler/create_sql_function.rs @@ -32,31 +32,56 @@ use crate::catalog::CatalogError; use crate::expr::{Expr, ExprImpl, Literal}; use crate::{bind_data_type, Binder}; +/// The error type for hint display +/// Currently we will try invalid parameter first +/// Then try to find non-existent functions +enum ErrMsgType { + Parameter, + Function, + // Not yet support + None, +} + const DEFAULT_ERR_MSG: &str = "Failed to conduct semantic check"; +/// Used for hint display const PROMPT: &str = "In SQL UDF definition: "; -pub const SQL_UDF_PATTERN: &str = "[sql udf]"; +/// Used for detecting non-existent function +const FUNCTION_KEYWORD: &str = "function"; -/// Create a mock `udf_context`, which is used for semantic check -fn create_mock_udf_context( - arg_types: Vec, - arg_names: Vec, -) -> HashMap { - let mut ret: HashMap = (1..=arg_types.len()) - .map(|i| { - let mock_expr = - ExprImpl::Literal(Box::new(Literal::new(None, arg_types[i - 1].clone()))); - (format!("${i}"), mock_expr) - }) - .collect(); +/// Used for detecting invalid parameters +pub const SQL_UDF_PATTERN: &str = "[sql udf]"; - for (i, arg_name) in arg_names.into_iter().enumerate() { - let mock_expr = ExprImpl::Literal(Box::new(Literal::new(None, arg_types[i].clone()))); - ret.insert(arg_name, mock_expr); +/// Validate the error message to see if +/// it's possible to improve the display to users +fn validate_err_msg(invalid_msg: &str) -> ErrMsgType { + // First try invalid parameters + if invalid_msg.contains(SQL_UDF_PATTERN) { + ErrMsgType::Parameter + } else if invalid_msg.contains(FUNCTION_KEYWORD) { + ErrMsgType::Function + } else { + // Nothing could be better display + ErrMsgType::None } +} - ret +/// Extract the target name to hint display +/// according to the type of the error message item +fn extract_hint_display_target(err_msg_type: ErrMsgType, invalid_msg: &str) -> Option<&str> { + match err_msg_type { + // e.g., [sql udf] failed to find named parameter + ErrMsgType::Parameter => invalid_msg.split_whitespace().last(), + // e.g., function does not exist + ErrMsgType::Function => { + let func = invalid_msg.split_whitespace().nth(1).unwrap_or("null"); + // Note: we do not want the parenthesis + func.find('(').map(|i| &func[0..i]) + } + // Nothing to hint display, return default error message + ErrMsgType::None => None, + } } /// Find the pattern for better hint display @@ -77,6 +102,27 @@ fn find_target(input: &str, target: &str) -> Option { Some(ma.start()) } +/// Create a mock `udf_context`, which is used for semantic check +fn create_mock_udf_context( + arg_types: Vec, + arg_names: Vec, +) -> HashMap { + let mut ret: HashMap = (1..=arg_types.len()) + .map(|i| { + let mock_expr = + ExprImpl::Literal(Box::new(Literal::new(None, arg_types[i - 1].clone()))); + (format!("${i}"), mock_expr) + }) + .collect(); + + for (i, arg_name) in arg_names.into_iter().enumerate() { + let mock_expr = ExprImpl::Literal(Box::new(Literal::new(None, arg_types[i].clone()))); + ret.insert(arg_name, mock_expr); + } + + ret +} + pub async fn handle_create_sql_function( handler_args: HandlerArgs, or_replace: bool, @@ -233,19 +279,20 @@ pub async fn handle_create_sql_function( if let ErrorCode::BindErrorRoot { expr: _, error } = e.inner() { let invalid_msg = error.to_string(); - // Valid error message for hint display - let Some(_) = invalid_msg.as_str().find(SQL_UDF_PATTERN) else { + // First validate the message + let err_msg_type = validate_err_msg(invalid_msg.as_str()); + + // Get the name of the invalid item + // We will just display the first one found + let Some(invalid_item_name) = + extract_hint_display_target(err_msg_type, invalid_msg.as_str()) + else { return Err( ErrorCode::InvalidInputSyntax(DEFAULT_ERR_MSG.into()).into() ); }; - // Get the name of the invalid item - // We will just display the first one found - let invalid_item_name = - invalid_msg.split_whitespace().last().unwrap_or("null"); - - // Find the invalid parameter / column + // Find the invalid parameter / column / function let Some(idx) = find_target(body.as_str(), invalid_item_name) else { return Err( ErrorCode::InvalidInputSyntax(DEFAULT_ERR_MSG.into()).into() diff --git a/src/frontend/src/handler/drop_view.rs b/src/frontend/src/handler/drop_view.rs index e11ae5ea36f8e..b24760c36c0c2 100644 --- a/src/frontend/src/handler/drop_view.rs +++ b/src/frontend/src/handler/drop_view.rs @@ -42,7 +42,7 @@ pub async fn handle_drop_view( Ok((t, s)) => (t, s), Err(e) => { return if if_exists { - Ok(RwPgResponse::builder(StatementType::DROP_MATERIALIZED_VIEW) + Ok(RwPgResponse::builder(StatementType::DROP_VIEW) .notice(format!("view \"{}\" does not exist, skipping", table_name)) .into()) } else { diff --git a/src/storage/src/row_serde/mod.rs b/src/storage/src/row_serde/mod.rs index 4cb6696cce931..138d2361468c5 100644 --- a/src/storage/src/row_serde/mod.rs +++ b/src/storage/src/row_serde/mod.rs @@ -30,14 +30,18 @@ pub fn find_columns_by_ids( table_columns: &[ColumnDesc], column_ids: &[ColumnId], ) -> (Vec, Vec) { - let mut table_columns = table_columns + if column_ids.is_empty() { + // shortcut + return (vec![], vec![]); + } + let id_to_columns = table_columns .iter() .enumerate() .map(|(index, c)| (c.column_id, (c.clone(), index))) .collect::>(); column_ids .iter() - .map(|id| table_columns.remove(id).unwrap()) + .map(|id| id_to_columns.get(id).expect("column id not found").clone()) .unzip() } diff --git a/src/tests/e2e_extended_mode/src/test.rs b/src/tests/e2e_extended_mode/src/test.rs index 3e822bbd04d31..26c9b9d4c2c96 100644 --- a/src/tests/e2e_extended_mode/src/test.rs +++ b/src/tests/e2e_extended_mode/src/test.rs @@ -75,6 +75,7 @@ impl TestSuite { self.simple_cancel(true).await?; self.complex_cancel(false).await?; self.complex_cancel(true).await?; + self.subquery_with_param().await?; Ok(()) } @@ -541,4 +542,17 @@ impl TestSuite { new_client.execute("drop table t3", &[]).await?; Ok(()) } + + async fn subquery_with_param(&self) -> anyhow::Result<()> { + let client = self.create_client(false).await?; + + let res = client + .query("select (select $1::SMALLINT)", &[&1024_i16]) + .await + .unwrap(); + + assert_eq!(res[0].get::(0), 1024_i16); + + Ok(()) + } } diff --git a/src/tests/libpq_test/Cargo.lock b/src/tests/libpq_test/Cargo.lock index 74beef901a9ea..686143d827141 100644 --- a/src/tests/libpq_test/Cargo.lock +++ b/src/tests/libpq_test/Cargo.lock @@ -4,67 +4,66 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "bindgen" @@ -96,15 +95,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "cexpr" @@ -123,9 +116,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -134,20 +127,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", @@ -157,21 +149,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.51", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -181,29 +173,18 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "either" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -219,20 +200,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "is-terminal" -version = "0.4.9" +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "hermit-abi", - "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -249,18 +222,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -288,21 +261,21 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minimal-lexical" @@ -322,9 +295,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "peeking_take_while" @@ -334,33 +307,33 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -370,9 +343,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -381,9 +354,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "risingwave_libpq_test" @@ -402,28 +375,28 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" @@ -438,9 +411,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -449,29 +422,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.51", ] [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "utf8parse" @@ -487,99 +460,144 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-targets 0.48.5", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.3", +] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows-targets", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" diff --git a/src/tests/libpq_test/Cargo.toml b/src/tests/libpq_test/Cargo.toml index 813cd37ca90b6..846a2e1059d66 100644 --- a/src/tests/libpq_test/Cargo.toml +++ b/src/tests/libpq_test/Cargo.toml @@ -10,6 +10,3 @@ edition = "2021" anyhow = "1" libpq = "3.0" clap = { version = "4", features = ["derive"] } - -[lints] -workspace = true diff --git a/src/workspace-hack/Cargo.toml b/src/workspace-hack/Cargo.toml index cd1bbc039287a..9bbeb2b9433f9 100644 --- a/src/workspace-hack/Cargo.toml +++ b/src/workspace-hack/Cargo.toml @@ -32,7 +32,6 @@ aws-smithy-types = { version = "1", default-features = false, features = ["byte- axum = { version = "0.6" } base64 = { version = "0.21", features = ["alloc"] } bigdecimal = { version = "0.4" } -bit-set = { version = "0.5" } bit-vec = { version = "0.6" } bitflags = { version = "2", default-features = false, features = ["serde", "std"] } byteorder = { version = "1" }