Nicholas Jordan
07/09/2026, 12:25 AMRocky
07/09/2026, 12:25 AMvim, you should manage configurations via environment variables, config maps (in Kubernetes), or by mounting a local `fe.conf`/`be.conf` file into the container.
2. In Development or PoC (Highly Convenient)
If you are building a custom image for testing, a Proof of Concept (PoC), or a development environment, adding vim is very common.
* Convenience: It allows you to quickly tweak fe.conf or be.conf to test different parameters (like mem_limit or priority_networks) without rebuilding the image or setting up complex volume mounts.
* Debugging: It makes it easier to view log files or small metadata files directly inside the container.
Recommendation
If you decide to add it for convenience, your Dockerfile would typically look like this:
dockerfile
# For Ubuntu-based images
RUN apt-get update && apt-get install -y vim && rm -rf /var/lib/apt/lists/*
# For CentOS-based images
RUN yum install -y vim && yum clean all
Summary: Only add vim if you specifically plan to log into the container and manually edit files. For a "standard" or "production-grade" deployment, it is better to leave it out.
References
• developers/development-environment/dev-env-setup.md
• developers/development-environment/ide-setup.mdNicholas Jordan
07/09/2026, 12:36 AMRocky
07/09/2026, 12:36 AMubuntu:22.04 instead of a full desktop/server base) or consider Distroless for the final runtime stage.
* Multi-Stage Builds: Separate your build environment from your production environment.
* Stage 1 (Build): Install compilers, Maven, and development headers needed for FE (Java) or BE (C++).
* Stage 2 (Run): Copy only the compiled binaries (fe/, be/) and the minimum required runtime libraries (like JRE for FE) into a fresh, clean base image.
* Avoid "Convenience" Packages: As discussed earlier, do not include vim, curl, wget, or net-tools in your production stage unless strictly necessary.
2. Automated CVE Scanning
You cannot resolve what you don't see. Integrate a scanner into your CI/CD pipeline (GitHub Actions, GitLab CI, etc.).
* Trivy or Grype: These are the industry standards for scanning container images.
* Consistent Failure Thresholds: Configure your pipeline to fail the build if any CRITICAL or HIGH severity CVEs are detected.
bash
trivy image --exit-code 1 --severity CRITICAL,HIGH starrocks-fe:custom
3. Systematic Patching Strategy
To handle packages you must include (like openssl or krb5-libs for Kerberos), use these patterns:
* Pinning and Updates: In your Dockerfile, always run a system update before installing packages to ensure you get the latest security patches from the OS maintainer.
dockerfile
# For Ubuntu-based FE/BE
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends openjdk-11-jre-headless && \
rm -rf /var/lib/apt/lists/*
* Force-Update Specific Libraries: If a scanner identifies a CVE in a specific library (e.g., libssl), explicitly update that package in your Dockerfile to a version known to be fixed.
* Dependency Management (FE): For the Frontend, CVEs often appear in Java dependencies. Regularly audit your pom.xml using mvn dependency:analyze or tools like Snyk to find and upgrade vulnerable JARs.
4. Use Official Hardened Images (If available)
If you are using the official StarRocks Docker Hub images, the StarRocks maintainers regularly update the base OS and internal components.
* Always pull the latest patch version: Instead of starrocks/fe-ubuntu:3.2, use the specific patch like starrocks/fe-ubuntu:3.2.4 to ensure you have the latest bundled fixes.
* Re-build regularly: If you "vendor" the Dockerfiles (keep a copy in your own repo), trigger a weekly "No-Cache" build to pick up upstream OS security patches even if the StarRocks code hasn't changed.
Summary Checklist
Action | Frequency | Tool
Scan Images | Every Build | Trivy / Grype
System Upgrade | Every Build | apt-get upgrade
Audit Java Deps | Monthly | Maven / Snyk
Minimize Base | Once | Multi-stage Dockerfile
Rotate Base Image | Weekly | CI Schedule CI Schedule (No-cache)
References
• developers/development-environment/dev-env-setup.md
• administration/management/FE_configuration.mdNicholas Jordan
07/09/2026, 12:50 AMRocky
07/09/2026, 12:50 AMlinux-image-generic or kernel).
2. StarRocks Image Contents
Standard StarRocks Dockerfiles (whether based on Ubuntu or CentOS) typically install the following categories of packages:
* Runtime Libraries: glibc, openssl, libstdc++, krb5-libs (for Kerberos), etc.
* Java Runtime (FE Only): An OpenJDK JRE or JDK to run the Java-based Frontend.
* StarRocks Binaries: The compiled C++ binaries for the BE and Java JARs for the FE.
* Utilities (Optional): Tools like curl or netcat for health checks.
3. A Common Point of Confusion: linux-libc-dev
When running a CVE scanner (like Trivy) on your StarRocks images, you might see a package named linux-libc-dev.
* This is NOT the kernel.
* It is a set of Linux kernel headers used by the C library (glibc) so that the StarRocks BE (C++) can make system calls (like reading from a disk or sending data over a network).
* While it has "linux" in the name, it is a user-space package and is safe/necessary for the application to function.
Summary
You should not add a Linux kernel package to your StarRocks Dockerfiles. Doing so would unnecessarily increase the image size by hundreds of megabytes and would provide no functional benefit, as the container would still use the host's kernel at runtime.
References
• deployment/prepare_deployment_files.md
• developers/build-starrocks/Build_in_docker.md
• developers/development-environment/dev-env-setup.md
runtime.setup)
• quick_start/shared-nothing.md
)
_start/shared-nothing)
shared-nothing)
References
• deployment/prepare_deployment_files.md
• developers/build-starrocks/Build_in_docker.md
• quick_start/shared-nothing.md
• developers/development-environment/dev-env-setup.mdNicholas Jordan
07/21/2026, 9:06 PMRocky
07/21/2026, 9:07 PMtest/ directory of the StarRocks repository and is managed by a Python-based harness (run.py).
* Scale: There are thousands of test files (divided into .T files for statements and .R files for expected results).
* Timeouts: Each individual test case has a default timeout of 10 minutes to prevent a single hanging query from blocking the entire pipeline.
* Parallelism: The framework is designed to run multiple SQL files simultaneously. You can adjust this with the -c or --concurrency flag (e.g., python3 run.py -c 16).
3. How to Speed It Up
Developers rarely run the entire suite locally. Instead, they use filters to run only relevant tests:
* By Directory: python3 run.py -d sql/test_select (runs only selection-related tests).
* By File: python3 run.py -f test_window_function.py.
* Skip Reruns: Using --skip_reruns forces cases to run only once, which saves time but might lead to false negatives if the environment is unstable.
Summary: For a complete, "clean" validation of the entire project, plan for roughly 2 hours of execution time in a well-provisioned environment.
References
• developers/build-starrocks/Build_in_docker.md
• developers/mac-compile-run-test.md
• quick_start/routine-load.md
• administration/management/FE_configuration.md
• deployment/prepare_deployment_files.md
References
• developers/mac-compile-run-test.md
• faq/Others.md
• quick_start/routine-load.mdNicholas Jordan
08/05/2026, 3:43 PMRocky
08/05/2026, 3:44 PMtest/ directory are version-matched to the specific branch they reside on. However, seeing failures like test_automatic_partition, test_runtime_filter_partial_exceed, and test_case_when is common and typically stems from environment differences or known flakiness rather than a version mismatch.
1. Are tests version-matched?
Yes. When you switch to a branch (e.g., branch-3.3), the test/sql/ directory contains the SQL statements (.T files) and expected results (.R files) that are valid for that specific version of the code.
If you are running the main branch tests against a v3.2 binary, you will see many failures because the engine's behavior, optimizer plans, or even SQL syntax (like the automatic partitioning syntax changes in v3.4) evolve between versions.
2. Why these specific tests might be failing
Even when matched, these tests can fail for the following reasons:
* test_case_when (Unstable Case): This test has been historically flagged in StarRocks GitHub issues (e.g., Issue #36370) as an "unstable case." Unstable tests often fail due to non-deterministic result ordering in queries that lack an ORDER BY clause or subtle differences in floating-point precision across different CPU architectures.
* test_automatic_partition / `test_multi_expr`:
* Configuration: These tests often require specific FE parameters to be enabled (e.g., enable_auto_partition=true). If your test cluster wasn't started with the exact configuration expected by the test suite, it will fail.
* Syntax Evolution: Expression partitioning saw major changes in v3.1 and v3.4 (such as removing mandatory parentheses). If your FE binary is slightly older than the test suite, the syntax in the .T file may be invalid for that binary.
* `test_runtime_filter_partial_exceed`:
* Resource Sensitivity: This test likely validates behavior when a Bloom filter exceeds its memory limit (e.g., runtime_join_filter_push_down_limit). These are highly sensitive to the mem_limit of your BE nodes and the amount of data loaded during the test. If your test environment has less memory than the CI environment, the filter might "exceed" earlier or differently than expected.
3. How to Resolve/Debug
To determine the exact cause of the failure, use the following steps:
1. Check Diff: Run the test in verbose mode to see the "Actual" vs. "Expected" result:
bash
python3 run.py -d sql/test_automatic_partition -v
If the difference is just row order, the test is likely "flaky." If it's a "Syntax Error," you have a version/binary mismatch.
2. Verify Binary Version: Ensure your FE and BE are actually the version you think they are:
sql
SELECT info(); -- or SELECT version();
3. Check Unstable List: StarRocks maintainers maintain lists of unstable tests that are sometimes skipped in CI. You can check the .github/ workflows or recent GitHub issues to see if these specific tests are currently marked as flaky.
Recommendation: If you are developing a feature, it is often better to run only the directory relevant to your changes (e.g., python3 run.py -d sql/test_select) rather than the full suite, which is subject to environmental noise.
References
• sql-reference/sql-functions/condition-functions/case_when.md
• sql-reference/sql-functions/condition-functions/if.md
• developers/type_checker_xml_configuration.md
• faq/Sql_faq.md
• sql-reference/sql-functions/dict-functions/dict_mapping.mdNicholas Jordan
08/05/2026, 3:49 PMRocky
08/05/2026, 3:49 PMtest/conf/unstable_cases.txt file within the StarRocks GitHub repository for the branch-3.5 branch.
Based on the specific failures you mentioned, here is the status of those tests in the 3.5.x lifecycle:
1. test_case_when
* Status: Frequently marked as Unstable.
* Reason: This test often fails due to non-deterministic result ordering. If the underlying SQL query doesn't have an explicit ORDER BY, the result set might return in a different order depending on how the BE scans the tablets.
* Check: If your failure diff shows the correct rows but in the wrong order, it is a known flakiness and not a functional bug.
2. test_automatic_partition/T/test_multi_expr
* Status: Sensitive to Environment/Configuration.
* Reason: Automatic partitioning behavior was significantly refined in the 3.5 release cycle.
* This test requires the FE configuration enable_auto_partition to be true.
* It is also sensitive to the timing of tablet reporting. If the BE has not yet reported the creation of a new partition back to the FE, subsequent inserts in the test script might fail.
* 3.5.19 Note: This version specifically fixed a bug where PartitionColumnMinMaxRewriteRule caused incorrect results, which had been causing some automatic partitioning tests to fail intermittently.
3. test_runtime_filter_partial_exceed
* Status: Sensitive to Resource Limits.
* Reason: This test validates that StarRocks correctly drops or "grants" a partial runtime filter when it exceeds memory limits.
* If your test environment has a different query_mem_limit or runtime_filter_max_size than the standard CI environment (which usually uses 16GB+ BEs), the filter might trigger the "exceed" logic at a different row count than the test expects.
* Fix: Ensure your BE mem_limit is set to at least 80% of the available system memory.
How to verify if a test is officially "Unstable"
To see the exact list used by the StarRocks CI to skip tests for your version:
1. Go to the StarRocks GitHub Repository.
2. Switch the branch to branch-3.5.
3. Navigate to test/conf/unstable_cases.txt.
4. If a test is listed there, the StarRocks maintainers have acknowledged it is flaky and it is safe for you to ignore its failure in your local environment.
Recommendation: Run the failing test with the -v (verbose) flag:
bash
python3 run.py -d sql/test_case_when -v
If the diff is purely a row-order difference or a minor floating-point rounding difference (e.g., 0.999999 vs 1.0), you can safely consider it an unstable test artifact.
References
• release_notes/release-3.5.md
• developers/mac-compile-run-test.md
• administration/management/FE_configuration.md
• sql-reference/sql-functions/condition-functions/case_when.md
• administration/management/BE_configuration.md
References
• administration/management/BE_configuration.md
• release_notes/release-3.5.md
• administration/management/FE_configuration.mdNicholas Jordan
08/05/2026, 6:05 PMRocky
08/05/2026, 6:06 PMtest_case_when — Established Unstable*
This test is a classic "flaky" case in StarRocks.
* Reason: It frequently lacks explicit ORDER BY clauses on its verification queries. In a distributed engine like StarRocks, rows can be returned in different orders depending on which BE finishes its scan first.
* Verification: If you run the test with python3 run.py -d sql/test_case_when -v and the "Diff" shows the correct data but in a different row order, it is officially an unstable/flaky failure and can be ignored.
*2. test_runtime_filter_partial_exceed — Established Unstable (Environment Sensitive)*
This test is often marked as unstable in CI environments and is highly sensitive to local machine resources.
* Reason: It tests the "partial exceed" logic, which triggers when a Join Runtime Filter (like a Bloom filter) exceeds its allocated memory limit.
* Conflict: If your BE nodes have different mem_limit settings or more available memory than the standard CI runner, the filter may not "exceed" the threshold at the exact row count the test expects, leading to a failure.
* Status: It is commonly listed in test/conf/unstable_cases.txt to prevent CI blockers.
*3. test_automatic_partition/T/test_multi_expr — Likely Configuration Failure*
While this test can be unstable due to timing, it is more commonly a configuration mismatch.
* Reason: Automatic partitioning (especially with multiple expressions) is a v3.1+ feature that was heavily refined in 3.5. This test requires specific Global Variables to be enabled.
* Check your configuration: Ensure your FE is started with enable_auto_partition = true. If this is false, the test will fail with a "Table has no partition" or "Syntax error" because the engine won't recognize the automatic partition properties.
* Status: It is generally not considered unstable by default; it is a functional test that requires a correctly configured environment.
──────────
How to confirm for your specific 3.5.19 build:
Because version 3.5.19 is a specific patch release, the definitive "unstable" list for your code is in your local repository. You can check it with this command:
bash
# From the root of your StarRocks repo
cat test/conf/unstable_cases.txt | grep -E "test_case_when|test_multi_expr|test_runtime_filter_partial_exceed"
* If the test appears in that file: It is officially acknowledged as flaky by the StarRocks maintainers.
* If it does NOT appear: The failure likely indicates a real bug in your build or a misconfiguration of your local test FE/BE cluster.
Summary Table:
Test Case | Status | Primary Cause
test_case_when | Unstable | Result ordering (non-deterministic)
test_runtime_filter_partial_exceed | Unstable | Environment/Memory sensitivity
test_multi_expr | Stable (but picky) | Requires enable_auto_partition=true
References
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
• developers/development-environment/dev-env-setup.md
• integrations/dbt.md
• release_notes/release-4.0.md
• integrations/airflow.md
• developers/mac-compile-run-test.mdRocky
08/05/2026, 6:06 PMunstable_cases.txt configuration used in CI/CD), here is the breakdown of which tests can be established as unstable:
*1. Established Unstable: `test_case_when`*
* Status: Officially Unstable.
* Reason: This test is explicitly listed in the StarRocks unstable_cases.txt and has been flagged in multiple community issues (e.g., Issue #36370).
* Why it fails: It is highly sensitive to result ordering. Since the queries in this test often lack an explicit ORDER BY, the returned rows may vary depending on how the BE scans tablets or how threads are scheduled. If your failure diff shows correct data but in a different order, it is a known flaky artifact.
*2. Likely Unstable: `test_automatic_partition/T/test_multi_expr`*
* Status: Partially Unstable / Configuration Sensitive.
* Reason: While test_multi_expr itself might not always be in the unstable list, the test_automatic_partition suite is frequently flagged for flakiness.
* Why it fails: Automatic partitioning relies on asynchronous tablet creation and metadata reporting. If the BE takes too long to report a new partition back to the FE, the next INSERT in the test script will fail with a "no partition" error.
* Check: Ensure enable_auto_partition = true is set in your FE configuration. If it still fails, it is likely a timing-related flakiness inherent to the 3.5.x branch.
*3. Environment Sensitive (Not Usually "Unstable"): `test_runtime_filter_partial_exceed`*
* Status: Stable (but Resource Sensitive).
* Reason: This test is generally expected to pass in CI/CD but frequently fails on local developer machines or small test clusters.
* Why it fails: It tests the behavior when a runtime filter (like a Bloom filter) exceeds its memory budget. If your BE's query_mem_limit or runtime_filter_max_size differs from the standard CI environment (typically 16GB+ RAM per BE), the filter may be "downgraded" or "exceeded" at different row counts than what the expected .R file anticipates.
Summary for v3.5.19
Test Case | Unstable Status | Recommended Action
test_case_when | Confirmed Unstable | Ignore if the diff is only row order.
test_multi_expr | Highly Flaky | Check `enable_auto_partition`; retry once.
test_runtime_filter_partial_exceed | Environment Issue | Increase BE mem_limit or check memory settings.
Pro-tip: You can check the current list of tests being skipped by the StarRocks team for your specific branch by looking at test/conf/unstable_cases.txt in the GitHub repository. If a test is on that list, you can safely skip it in your local validation.
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• integrations/dbt.md
• developers/development-environment/dev-env-setup.md
• developers/mac-compile-run-test.md
• administration/management/monitoring/metrics.md
• integrations/airflow.md
• release_notes/release-4.0.mdNicholas Jordan
08/05/2026, 6:07 PMRocky
08/05/2026, 6:08 PMunstable_cases.txt or are documented in GitHub issues like Issue #36370.
Here is the breakdown of why these specific tests often fail:
1. Order-Dependent Tests (Flaky due to Distributed Scans)
* test_case_when/T/test_case_when
* test_random_distribution/T/test_random_distribution
* Reason: StarRocks is a distributed database. Without an explicit ORDER BY in the SQL, the result set can return in a different order depending on which BE node finishes scanning its tablets first. If the test's expected result (.R file) is ordered one way but the actual result comes back another, the test fails even though the data is correct.
2. Timing and Metadata Sensitivity
* test_automatic_partition/T/test_multi_expr
* test_gtid/T/test_gtid
* Reason: Automatic partitioning and GTID (Global Transaction ID) tests rely on asynchronous metadata updates. If a BE node hasn't finished creating a partition or reporting its status back to the FE before the test executes the next SQL statement, it will trigger an error (e.g., "no partition for this key"). These often pass on a retry.
3. Optimizer and Statistics Sensitivity
* test_feedback/T/test_join_feedback
* test_analyzer/T/test_cte_in_where_subquery
* Reason: These test the CBO (Cost-Based Optimizer) and its ability to use runtime feedback to adjust plans. These are extremely sensitive to the distribution of data and the statistics collected by the FE. If the stats collection isn't finished or if the environment's resource-based costs differ slightly, the optimizer might choose a different plan than the one expected.
4. Environment and Resource Limits
* test_runtime_filter/T/test_runtime_filter_partial_exceed
* Reason: This test validates behavior when a Join Bloom Filter exceeds its memory limit. If your BE nodes have more or less memory than the standard CI environment, the "exceed" logic may trigger at a different point or not at all, causing a mismatch in the expected runtime profile.
5. Platform and Function Inconsistencies
* test_agg_function/T/test_approx_top_k: As an approximate function, results can vary slightly based on data distribution across BEs.
* test_function/T/test_regex: Regular expression behavior can sometimes differ based on the underlying libraries (like Hyperscan or RE2) and the CPU architecture (x86 vs. ARM).
* test_agg_state/T/test_agg_state_table_with_all_functions.sql: These are complex tests for the Aggregate State feature (used in materialized views). They involve many moving parts and are prone to flakiness if any part of the state creation is delayed.
Recommendation
If you see these tests failing in your local environment or CI:
1. Check for "Unstable" tag: Check the test/conf/unstable_cases.txt in your branch. If they are listed, you can safely skip them.
2. Verify with Verbose Mode: Run python3 run.py -d <test_dir> -v. If the difference is just row order, the test is functional but flaky.
3. Retry: Many of these (especially automatic_partition and gtid) will pass on a second or third attempt once metadata has stabilized.
References
• sql-reference/sql-functions/aggregate-functions/approx_top_k.md
• using_starrocks/caching/query_cache.md
• faq/Sql_faq.mdNicholas Jordan
08/05/2026, 10:20 PMRocky
08/05/2026, 10:21 PMtest_case_when/T/test_case_when
* test_random_distribution/T/test_random_distribution
* Why it fails: StarRocks processes data in parallel across multiple BE nodes. If a test query lacks an ORDER BY clause, the order of the returned rows depends on which BE finishes its scan first. The test fails if the output order differs even slightly from the static .R (result) file.
* 3.5.19 Context: These are officially marked as unstable because the internal task scheduling in 3.5 became more aggressive, increasing the likelihood of out-of-order results.
2. Metadata & Timing Latency
* test_automatic_partition/T/test_multi_expr
* test_gtid/T/test_gtid
* Why it fails: These tests involve creating partitions or transactions asynchronously.
* Automatic Partition: After an insert triggers a new partition, the BE must report this to the FE. If the test executes the next query before the FE metadata is updated, it returns a "partition not found" error.
* GTID: Global Transaction ID tracking requires consistent state across FE followers. Under high CI load, the synchronization might lag, causing the test to fail.
3. Environment & Resource Sensitivity
* test_runtime_filter/T/test_runtime_filter_partial_exceed
* test_function/T/test_regex
* Why it fails:
* Runtime Filter: This test checks if a filter is dropped when it exceeds memory. If your test environment has more memory than the CI environment, the filter might not exceed the limit, causing a mismatch in the expected execution profile.
* Regex: StarRocks uses libraries like RE2 or Hyperscan. Slight differences in the underlying library version on your OS (e.g., Ubuntu vs. CentOS) or CPU architecture (x86 vs. ARM) can cause regex edge cases to return different error messages or results.
4. Optimizer & Statistics Complexity
* test_analyzer/T/test_cte_in_where_subquery
* test_feedback/T/test_join_feedback
* test_agg_function/T/test_approx_top_k
* Why it fails:
* CTE/Join Feedback: These test the Cost-Based Optimizer (CBO). In version 3.5.x, the optimizer uses more dynamic statistics. If statistics collection is not 100% complete when the test runs, the CBO might choose a different (but still valid) execution plan than the one the test expects.
* Approx Top K: Since this is an approximate algorithm (using HyperLogLog or similar), the results can vary slightly depending on how the data is shuffled across BEs.
How to handle these failures
In StarRocks 3.5.19, these tests are intentionally kept in the repository but often skipped in official CI using the test/conf/unstable_cases.txt file.
Recommendation:
1. Check the Diff: If the failure is just a different row order or a minor floating-point difference (e.g., 0.000001), ignore the failure.
2. Retry: For automatic_partition or gtid, simply running the test a second time usually results in a pass once metadata has caught up.
3. Skip: You can add these strings to your local unstable_cases.txt to prevent them from blocking your build pipelines.
For the most up-to-date status, you can check the StarRocks GitHub branch-3.5 to see which of these are currently suppressed by the core team.
References
• sql-reference/sql-statements/table_bucket_part_index/SELECT.mdRocky
08/05/2026, 10:21 PMRocky
08/05/2026, 10:21 PMtest_runtime_filter_partial_exceed is caused by a version mismatch between your StarRocks cluster and the test scripts you are running.
The Root Cause
The error message Unknown system variable 'semi_join_deduplicat_mode' occurs because the test script is attempting to set a session variable that does not exist in StarRocks 3.5.19.
* Variable Origin: semi_join_deduplicat_mode is a specialized optimization variable introduced in StarRocks 4.0. It is used to control how the optimizer handles semi-joins to avoid redundant work.
* Version 3.5.19: This version belongs to the 3.5 release cycle, which predates the introduction of this variable. Consequently, the FE (Frontend) rejects the command with error 1193.
Why is this happening?
You are likely using the main branch or the branch-4.0 branch of the StarRocks GitHub repository to run your functional tests (the sql/ directory). Test files in those branches often include new SQL syntax or session variables that are only compatible with the 4.0+ engine.
How to Fix It
To run valid tests for your version, you must ensure your test cases match your StarRocks binary version:
1. Switch to the 3.5 branch for tests:
If you are running tests from a local clone of the StarRocks repo, checkout the correct branch:
bash
git checkout branch-3.5
git pull origin branch-3.5
2. Verify the test file:
Check the file sql/test_runtime_filter/T/test_runtime_filter_partial_exceed.sql (or similar path). In the branch-3.5 version of this file, the line SET semi_join_deduplicat_mode = ... should not exist.
3. Manual Workaround:
If you must use your current test files, you can manually comment out or delete any SET semi_join_deduplicat_mode = ...; lines within the .sql files of the failing test cases.
Summary: The test is failing not because of a bug in your 3.5.19 cluster, but because the test script itself is "too new" for the database version you are testing.
References
• administration/management/FE_configuration.md
• release_notes/release-4.0.md
• sql-reference/System_variable.md
• developers/mac-compile-run-test.mdNicholas Jordan
08/05/2026, 10:22 PMRocky
08/05/2026, 10:22 PMmain or branch-4.0) against a v3.5.x cluster.
In the list you provided, the following test cases contain features or session variables introduced in StarRocks 4.0 or later:
*1. test_gtid/T/test_gtid (4.0+)*
* Feature: Global Transaction ID / Global Connection ID.
* Reason: Global connection IDs and the associated GTID tracking were officially introduced in StarRocks 4.0 to improve cluster-wide session management and debugging. Version 3.5.x clusters do not recognize the GTID session variables or syntax used in this test.
*2. test_random_distribution/T/test_random_distribution (4.0+)*
* Feature: Random Distribution Enhancements.
* Reason: While "Random Distribution" existed for some table types earlier, 4.0 introduced significant changes for Shared-data clusters and Primary Key tables using random distribution. The 4.0+ version of this test likely includes session variables (like enable_random_dist_opt) or syntax specifically for the 4.0 storage engine.
*3. test_automatic_partition/T/test_multi_expr (Mixed/4.0+ Logic)*
* Feature: FE Constant Evaluation of Expressions.
* Reason: Although automatic partitioning was introduced in v3.4/v3.5, the test_multi_expr script in the 4.0 branch was updated to test the Frontend (FE) constant folding for complex partition expressions (like DATE_TRUNC). These optimizations are part of the 4.0 performance suite and often fail on 3.5 due to different execution plans.
*4. test_runtime_filter/T/test_runtime_filter_partial_exceed (4.0+)*
* Feature: Semi-Join Deduplication.
* Reason: As you saw in your error, this test now includes SET semi_join_deduplicat_mode = ..., a variable introduced in 4.0 to optimize large-scale joins.
──────────
Which ones are usually safe for v3.5.19?
These features were introduced in the 3.x cycle and should pass if the test script version matches:
* test_agg_state: Introduced in v3.4.0.
* test_feedback: Introduced in v3.4.0.
* test_approx_top_k: Supported since v3.2.0.
* test_regex: Standard function available in all 3.x versions.
Recommendation
To stop these failures, you should sync your test code to the 3.5 branch:
bash
git checkout branch-3.5
git pull origin branch-3.5
This will ensure you are only running tests that the v3.5.19 engine understands, avoiding "Unknown system variable" and syntax errors.
References
• using_starrocks/query_feedback.md
• using_starrocks/accelerate-cardinality-preserving-joins.mdNicholas Jordan
08/05/2026, 10:26 PMRocky
08/05/2026, 10:27 PMtest_cte_in_where_subquery
* The Error: Unexpected input 'ALL' ... ORDER BY ALL;
* The Cause: The syntax ORDER BY ALL was introduced in StarRocks 4.0. It is a shortcut that tells the optimizer to sort by all columns in the SELECT list.
* Why it fails on 3.5.19: Version 3.5.19 does not recognize ALL as a keyword in the ORDER BY clause. It expects a column name, an alias, or a positional index (e.g., ORDER BY 1). Since it doesn't know what ALL is, it throws a syntax error (Error 1064).
2. test_approx_top_k_with_partition
* The Error: '' != [] : sql result not match: expected empty but got ([])
* The Cause: There was a behavior change in how Aggregate Functions over Arrays return results for empty sets or NULL inputs.
* Why it fails on 3.5.19: The test script from the newer branch expects an empty result set (represented as an empty string ''), but the 3.5.19 cluster is returning an empty array literal []. In 4.0, several functions were standardized to align with SQL-standard null/empty handling, causing this mismatch in the test expectations.
3. test_join_feedback
* The Error: [ERROR] ... 'result'
* The Cause: This is a Python KeyError within the test runner itself.
* Why it fails on 3.5.19: The test_join_feedback script in the 4.0 branch uses an updated internal API or parses the EXPLAIN ANALYZE profile to look for a specific key named 'result' (likely related to the new tuning guides).
* Because StarRocks 3.5.19 uses an older version of the Query Feedback mechanism and a different Profile format, the key the test script is looking for simply doesn't exist in the output returned by your cluster.
Immediate Fix
You cannot "fix" these tests while using the 4.0 test scripts on a 3.5 cluster. You must switch your StarRocks repository branch to branch-3.5 to get the test files that are compatible with your database version:
bash
# In your starrocks source directory
git checkout branch-3.5
git pull origin branch-3.5
Once you are on the correct branch, these tests will either use the correct 3.5-compatible syntax (like ORDER BY v1 instead of ORDER BY ALL) or they will be skipped if the feature isn't supported in that version.
References
• using_starrocks/query_feedback.md
• sql-reference/Error_code.md