Files
doris/regression-test
Jerry Hu 4088359429 [fix](be) Reset quantile union state for empty window frames (#69964)
### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: A bounded ROWS window can become empty after a nonempty
frame. The `quantile_union` reset previously restored only the
first-input flag and retained the preceding `QuantileState`. Without a
subsequent value to merge, an empty or NULL-only frame returned the
preceding frame's quantiles. Reset both the first-input flag and the
stored samples before each frame. The logical reset retains explicit
sample-vector capacity for reuse, while `clear()` preserves its
storage-release behavior.

### Release note

Fix `quantile_union` over empty window frames: `quantile_percent` now
returns NaN instead of values from the preceding frame.

### Check List (For Author)

- Test: ASAN BE unit tests (47 passed); ASAN BE+FE build (including FE
Checkstyle); three isolated SQL regression suites (1 suite passed each);
clang-format, format check, build hygiene, changed-line clang-tidy (no
warnings), and diff check. No performance benchmark was run.
- Behavior changed: Yes (empty window frames no longer inherit the
preceding quantile state).
- Does this need documentation: No.
2026-11-03 11:46:56 +08:00
..
…

Guide for test cases

General Case

  1. Write "def" before variable names; otherwise, they will be global variables and may be affected by other cases running in parallel.

    Problematic code:

    ret = ***
    

    Correct code:

    def ret = ***
    
  2. Avoid setting global session variables or modifying cluster configurations in cases, as it may affect other cases.

    Problematic code:

    sql """set global enable_pipeline_x_engine=true;"""
    

    Correct code:

    sql """set enable_pipeline_x_engine=true;"""
    
  3. If it is necessary to set global variables or modify cluster configurations, specify the case to run in a nonConcurrent manner.

    Example

  4. For cases involving time-related operations, it is best to use fixed time values instead of dynamic values like the now() function to prevent cases from failing after some time.

    Problematic code:

    sql """select count(*) from table where created < now();"""
    

    Correct code:

    sql """select count(*) from table where created < '2023-11-13';"""
    
  5. After streamloading in a case, add a sync to ensure stability when executing in a multi-FE environment.

    Problematic code:

    streamLoad { ... }
    sql """select count(*) from table """
    

    Correct code:

    streamLoad { ... }
    sql """sync"""
    sql """select count(*) from table """
    
  6. For UDF cases, make sure to copy the corresponding JAR file to all BE machines.

    Example

  7. Do not create the same table in different cases under the same directory to avoid conflicts.

  8. Cases injected should be marked as nonConcurrent and ensured injection to be removed after running the case.

  9. Docker case run in a docker cluster. The docker cluster is new created and independent, not contains history data, not affect other cluster.

    Docker case can add/drop/start/stop/restart fe and be, and specify fe and be num.

    Example will see demo_p0/docker_action.groovy

    Read the annotation carefully in the example file.

    Also read the doris-compose readme.

  10. Do not use raw Thread.start or Thread.startDaemon to run SQL in a case. Use the framework thread or extraThread helper and call future.get() to wait for completion, so exceptions are reported to the case that created the thread.

    Problematic code:

    def t = Thread.start {
        sql """insert into tbl values (1)"""
    }
    t.join()
    

    Correct code:

    def future = thread("insert-thread") {
        sql """insert into tbl values (1)"""
    }
    future.get()
    

Compatibility case

Refers to the resources or rules created on the initial cluster during FE testing or upgrade testing, which can still be used normally after the cluster restart or upgrade, such as permissions, UDF, etc.

These cases need to be split into two files, load.groovy and xxxx.groovy, placed in a folder, and tagged with the restart_fe group label, example.