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 a0544239d4e1..a7c45d363e8f 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -1438,10 +1438,10 @@ script = '''
 UPDATE_EXPECT=1 cargo test -p risingwave_connector tests::test_with_options_yaml_up_to_date
 '''
 
-#[tasks.backwards-compat-test]
-#category = "RiseDev - Test - Backwards Compatibility Test"
-#description = "Run backwards compatibility test"
-#script = "./e2e_test/backwards-compat-tests/scripts/run_local.sh"
+[tasks.backwards-compat-test]
+category = "RiseDev - Test - Backwards Compatibility Test"
+description = "Run backwards compatibility test"
+script = "./e2e_test/backwards-compat-tests/scripts/run_local.sh"
 
 # For debugging.
 # To show the env for a specific task, use `run_task = "show-env"` for that task.
diff --git a/ci/workflows/main-cron.yml b/ci/workflows/main-cron.yml
index df022c8fb927..f1fffc51dcab 100644
--- a/ci/workflows/main-cron.yml
+++ b/ci/workflows/main-cron.yml
@@ -615,40 +615,40 @@ steps:
     timeout_in_minutes: 5
 
   # Backwards compatibility tests
-  #  - label: "Backwards compatibility tests version_offset={{matrix.version_offset}}"
-  #    key: "backwards-compat-tests"
-  #    command: "VERSION_OFFSET={{matrix.version_offset}} RW_COMMIT=$BUILDKITE_COMMIT ci/scripts/backwards-compat-test.sh -p ci-release"
-  #    if: |
-  #      !(build.pull_request.labels includes "ci/main-cron/run-selected") && build.env("CI_STEPS") == null
-  #      || build.pull_request.labels includes "ci/run-backwards-compat-tests"
-  #      || build.env("CI_STEPS") =~ /(^|,)backwards?-compat-tests?(,|$$)/
-  #    depends_on:
-  #      - "build"
-  #    plugins:
-  #      - docker-compose#v5.1.0:
-  #          run: source-test-env
-  #          config: ci/docker-compose.yml
-  #          mount-buildkite-agent: true
-  #          environment:
-  #            - BUILDKITE_BRANCH
-  #      - ./ci/plugins/upload-failure-logs
-  #    matrix:
-  #      setup:
-  #        # Test the 4 latest versions against the latest main.
-  #        # e.g.
-  #        # 1: 2.0.0
-  #        # 2: 1.1.1
-  #        # 3: 1.0.1
-  #        # 4: 1.0.0
-  #        # It is ordered by the full version number, rather than minor / major version.
-  #        # We can change to just be on major version in the future.
-  #        version_offset:
-  #          - "1"
-  #          - "2"
-  #          - "3"
-  #          - "4"
-  #    timeout_in_minutes: 30
-  #    retry: *auto-retry
+  - label: "Backwards compatibility tests version_offset={{matrix.version_offset}}"
+    key: "backwards-compat-tests"
+    command: "VERSION_OFFSET={{matrix.version_offset}} RW_COMMIT=$BUILDKITE_COMMIT ci/scripts/backwards-compat-test.sh -p ci-release"
+    if: |
+      !(build.pull_request.labels includes "ci/main-cron/run-selected") && build.env("CI_STEPS") == null
+      || build.pull_request.labels includes "ci/run-backwards-compat-tests"
+      || build.env("CI_STEPS") =~ /(^|,)backwards?-compat-tests?(,|$$)/
+    depends_on:
+      - "build"
+    plugins:
+      - docker-compose#v5.1.0:
+          run: source-test-env
+          config: ci/docker-compose.yml
+          mount-buildkite-agent: true
+          environment:
+            - BUILDKITE_BRANCH
+      - ./ci/plugins/upload-failure-logs
+    matrix:
+      setup:
+        # Test the 4 latest versions against the latest main.
+        # e.g.
+        # 1: 2.0.0
+        # 2: 1.1.1
+        # 3: 1.0.1
+        # 4: 1.0.0
+        # It is ordered by the full version number, rather than minor / major version.
+        # We can change to just be on major version in the future.
+        version_offset:
+          - "1"
+          - "2"
+          - "3"
+          - "4"
+    timeout_in_minutes: 30
+    retry: *auto-retry
 
   # Sqlsmith differential testing
   - label: "Sqlsmith Differential Testing"
diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml
index e10ffb2d0091..8b852b6bb0b0 100644
--- a/ci/workflows/pull-request.yml
+++ b/ci/workflows/pull-request.yml
@@ -698,39 +698,38 @@ steps:
     timeout_in_minutes: 60 # ~3-4 queries can run
 
   # Backwards compatibility tests
-  # TODO: support backwards compatibility tests for sql backend
-  #  - label: "Backwards compatibility tests"
-  #    command: "VERSION_OFFSET={{matrix.version_offset}} RW_COMMIT=$BUILDKITE_COMMIT ci/scripts/backwards-compat-test.sh -p ci-dev"
-  #    if: |
-  #      build.pull_request.labels includes "breaking-change" ||
-  #        build.pull_request.labels includes "ci/run-backwards-compat-tests" ||
-  #        build.env("CI_STEPS") =~ /(^|,)backwards?-compat-tests?(,|$$)/
-  #    depends_on:
-  #      - "build"
-  #    plugins:
-  #      - docker-compose#v5.1.0:
-  #          run: source-test-env
-  #          config: ci/docker-compose.yml
-  #          mount-buildkite-agent: true
-  #          environment:
-  #            - BUILDKITE_BRANCH
-  #      - ./ci/plugins/upload-failure-logs
-  #    matrix:
-  #      setup:
-  #        # Test the 4 latest versions against the latest main.
-  #        # e.g.
-  #        # 1: 2.0.0
-  #        # 2: 1.1.1
-  #        # 3: 1.0.1
-  #        # 4: 1.0.0
-  #        # It is ordered by the full version number, rather than minor / major version.
-  #        # We can change to just be on major version in the future.
-  #        version_offset:
-  #          - "1"
-  #          - "2"
-  #          - "3"
-  #          - "4"
-  #    timeout_in_minutes: 25
+  - label: "Backwards compatibility tests"
+    command: "VERSION_OFFSET={{matrix.version_offset}} RW_COMMIT=$BUILDKITE_COMMIT ci/scripts/backwards-compat-test.sh -p ci-dev"
+    if: |
+      build.pull_request.labels includes "breaking-change" ||
+        build.pull_request.labels includes "ci/run-backwards-compat-tests" ||
+        build.env("CI_STEPS") =~ /(^|,)backwards?-compat-tests?(,|$$)/
+    depends_on:
+      - "build"
+    plugins:
+      - docker-compose#v5.1.0:
+          run: source-test-env
+          config: ci/docker-compose.yml
+          mount-buildkite-agent: true
+          environment:
+            - BUILDKITE_BRANCH
+      - ./ci/plugins/upload-failure-logs
+    matrix:
+      setup:
+        # Test the 4 latest versions against the latest main.
+        # e.g.
+        # 1: 2.0.0
+        # 2: 1.1.1
+        # 3: 1.0.1
+        # 4: 1.0.0
+        # It is ordered by the full version number, rather than minor / major version.
+        # We can change to just be on major version in the future.
+        version_offset:
+          - "1"
+          - "2"
+          - "3"
+          - "4"
+    timeout_in_minutes: 25
 
   # Sqlsmith differential testing
   - label: "Sqlsmith Differential Testing"


Test patch:
diff --git a/ci/scripts/backwards-compat-test.sh b/ci/scripts/backwards-compat-test.sh
index d6b64d91e6e3..c6bae012f7ad 100755
--- a/ci/scripts/backwards-compat-test.sh
+++ b/ci/scripts/backwards-compat-test.sh
@@ -46,22 +46,22 @@ echo "--- Setting up cluster config"
 full-without-monitoring:
   steps:
     - use: minio
-    - use: etcd
+    - use: sqlite
     - use: meta-node
     - use: compute-node
     - use: frontend
     - use: compactor
 EOF
   else
-     # For versions >= 1.9.0, the default config will default to sql backend,
-     # breaking backwards compat, so we must specify meta-backend: etcd
+     # For versions >= 1.9.0, we have support for different sql meta-backend,
+     # so we need to specify the meta-backend: sqlite
      cat <<EOF > risedev-profiles.user.yml
 full-without-monitoring:
  steps:
    - use: minio
-   - use: etcd
+   - use: sqlite
    - use: meta-node
-     meta-backend: etcd
+     meta-backend: sqlite
    - use: compute-node
    - use: frontend
    - use: compactor