Repository: risingwavelabs/risingwave (language: python)

Issue:
Sqlsmith: Sql feature generation
As we add more features, these should be tested via sqlsmith as well.

SQL Features:
- [ ] Generate other table functions: `generate_series`, `unnest`. See: https://github.com/singularity-data/risingwave/issues/4540
- [ ] Generate array_agg, jsonb_agg, jsonb_object_agg
- [ ] Generate select from System Tables
- [ ] Generate `NATURAL JOIN`
- [ ] Generate `JOIN` with `USING`
- [ ] Generate query w/o `GROUP BY`
- [ ] Randomly toggle session variables
- [ ] Generate `pow`/`exp`.
- [ ] Generate TopN by group: https://www.risingwave.dev/docs/current/sql-pattern-topn/
- [ ] Generate jsonb exprs, see: https://github.com/risingwavelabs/risingwave/issues/7714
- [ ] #7132
- [x] Generate order-by-clauses with `NULLS { FIRST | LAST }` (will be done in https://github.com/risingwavelabs/risingwave/pull/10864/commits/000cbc11cbc04f20abfd127b1bf4b3fd24e75c44)
- [ ] Generate `max`,`min`,`count` for `timestamptz`
- [ ] Generate `bit_and`, `bit_or` and `big_xor` in batch queries, and `bit_xor` in streaming queries.
- [ ] Generate array range access.
- [ ] https://github.com/risingwavelabs/risingwave/issues/10241
- [ ] Generate window functions other than `row_number`, `rank`.
- [ ] Generate `ALTER` DDL statements.\
- [ ] https://github.com/risingwavelabs/risingwave/issues/10516
- [ ] Generate temporal filter in sqlsmith


Discussion / hints:

Fix patch:
diff --git a/Makefile.toml b/Makefile.toml
index 08d9e1fbf7e2..400db7519610 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -369,7 +369,11 @@ ln -s "$(pwd)/target/${RISEDEV_BUILD_TARGET_DIR}${BUILD_MODE_DIR}/risingwave" "$
 [tasks.post-build-risingwave]
 category = "RiseDev - Build"
 description = "Copy RisingWave binaries to bin"
-condition = { env_set = ["ENABLE_BUILD_RUST"], env_not_set = ["USE_SYSTEM_RISINGWAVE"] }
+condition = { env_set = [
+    "ENABLE_BUILD_RUST",
+], env_not_set = [
+    "USE_SYSTEM_RISINGWAVE",
+] }
 dependencies = [
     "link-all-in-one-binaries",
     "link-user-bin",
@@ -846,6 +850,11 @@ script = """
 #!/usr/bin/env bash
 set -e
 
+echo "Running Planner Test requires larger stack size, setting RUST_MIN_STACK to 8388608 (8MB) as default."
+if [[ -z "${RUST_MIN_STACK}" ]]; then
+  export RUST_MIN_STACK=8388608
+fi
+
 cargo nextest run --workspace --exclude risingwave_simulation "$@"
 """
 description = "🌟 Run unit tests"
@@ -1281,7 +1290,7 @@ echo If you still feel this is not enough, you may copy $(tput setaf 4)risedev$(
 [tasks.ci-start]
 category = "RiseDev - CI"
 dependencies = ["clean-data", "pre-start-dev"]
-command = "target/debug/risedev-dev" # `risedev-dev` is always built in dev profile
+command = "target/debug/risedev-dev"                                                 # `risedev-dev` is always built in dev profile
 env = { RISEDEV_CLEAN_START = true }
 args = ["${@}"]
 description = "Clean data and start a full RisingWave dev cluster using risedev-dev"


Test patch:
diff --git a/ci/scripts/pr-unit-test.sh b/ci/scripts/pr-unit-test.sh
index 25f11f446206..73b50909802b 100755
--- a/ci/scripts/pr-unit-test.sh
+++ b/ci/scripts/pr-unit-test.sh
@@ -5,4 +5,8 @@ set -euo pipefail
 
 source ci/scripts/common.sh
 source ci/scripts/pr.env.sh
+
+# Set RUST_MIN_STACK to 8MB to avoid stack overflow in planner test.
+# This is a Unit Test specific setting.
+export RUST_MIN_STACK=8388608
 ./ci/scripts/run-unit-test.sh