This is an automated email from the ASF dual-hosted git repository.

Gabriel39 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ec7f806fa39 [fix](regression) Repair ES source predicate regression 
cases (#70155)
ec7f806fa39 is described below

commit ec7f806fa3907f9be936cbaa789eb0a20476d41c
Author: Gabriel <[email protected]>
AuthorDate: Wed Nov 4 13:48:36 2026 +0800

    [fix](regression) Repair ES source predicate regression cases (#70155)
    
    ### What problem does this PR solve?
    
    Issue Number: N/A
    
    Related PR: #69672, #69723
    
    External ES regression suites fail during setup or retain expectations
    from the previous indexed-value predicate behavior:
    
    - Read the deprecated scanner option through `SELECT
    @@enable_file_scanner_v2`, whose compatibility name remains valid when
    SHOW prefixes deprecated names.
    - On ES 8.3.3, fall back from the specifically unsupported
    `_source.mode` mapping syntax to `enabled:false`, retaining the
    disabled-source row and alias checks. Other HTTP failures remain fatal;
    supporting ES8 versions still exercise the mode syntax.
    - Compare LIKE, REGEXP, NULL and `level` predicates against unfiltered
    rows materialized into internal tables, then update only the affected
    runner-generated golden blocks.
    - Make the date-string equality test explicitly use source reads, test
    midnight as the matching value, and retain 08:00 as a negative control.
    - Check that a residual predicate prevents early termination while a
    safe numeric docvalue predicate still permits LIMIT pushdown.
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test
      - [x] Regression test
      - [ ] Unit Test
      - [x] Manual test
    
    Validation uses fresh FE and ASAN BE artifacts built from this PR commit
    (`6386f5f83a51b548c86ab3cff83d53cb48fb18df`) with the standard
    `./build.sh --fe --be -j64` entry point. The complete build exited
    successfully, and both finished artifact versions match that commit. No
    production source is changed by this PR.
    
    - On the same fresh binaries and reset ES 5.6.16, 6.8.23, 7.17.5 and
    8.3.3 fixtures, the parent suites/golden files reproduced all ten
    failures; the final PR suites passed all ten in normal comparison, with
    zero failed, fatal or skipped suites. The passing run executed 2,154
    golden checks and 1,798 independent query comparisons, without
    force-generation or further golden edits.
    - The complete `test_es_query` passed all four ES versions and both
    scroll settings, including its unchanged complex-array golden blocks
    (276 result checks and 20 independent comparisons).
    - Independent SQLite/Python evaluation of the unchanged raw fixture JSON
    passed 38 comparisons and covered all 17 changed golden blocks. Real ES
    requests also confirmed that `ignore_above` omits matching index values
    while retaining source strings, and that the constant-keyword index
    matches documents whose source `level` is absent.
    - Captured ES search requests verified the date modes: the original
    four-column projection reads source, returns midnight values and rejects
    the 08:00 predicate. A date-only docvalue projection correctly returns
    08:00 in the +08:00 session. The revised test explicitly fixes the
    source contract and retains the 08:00 negative control.
    - The complete fallback suite additionally passed normal comparison on
    ES 8.11.3: 304 golden checks and 304 independent comparisons. The actual
    mappings and document responses confirmed absent source for both the ES
    8.3.3 `enabled:false` fallback and the supported ES 8.11.3
    `mode:disabled` branch.
    - The existing `test_es_file_scanner_v2` compatibility suite also passed
    on the fresh build across all four fixture versions. The deprecated
    option is accepted; this does not claim two distinct physical reader
    implementations on current master.
    - Direct variable probes confirmed the old exact SHOW name returns no
    rows, the wildcard SHOW name exposes its deprecated prefix, and the
    scalar compatibility name remains readable.
    - `git diff --check` passed. ES9 compatibility is not claimed.
    
    - Behavior changed:
    - [x] No production behavior change; regression fixtures and
    expectations are corrected.
      - [ ] Yes.
    
    - Does this need documentation?
      - [x] No.
      - [ ] Yes.
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label
---
 .../data/external_table_p2/es/test_es_query.out    | 24 ++++-------
 .../external_table_p2/es/test_es_query_nereids.out |  2 +
 .../es/test_es_query_predicate_correctness.out     |  4 ++
 .../es/test_es_epoch_millis.groovy                 |  3 +-
 .../es/test_es_mapping_boundaries.groovy           |  3 +-
 .../es/test_es_numeric_source_semantics.groovy     |  3 +-
 .../external_table_p2/es/test_es_query.groovy      | 29 +++++++++++++
 .../es/test_es_query_nereids.groovy                | 18 +++++++-
 .../es/test_es_query_predicate_correctness.groovy  | 48 ++++++++++++++++------
 .../es/test_es_scalar_materialization.groovy       |  3 +-
 .../es/test_es_source_fallback_types.groovy        | 27 +++++++++---
 .../es/test_es_source_semantics.groovy             |  3 +-
 .../es/test_es_source_value_boundaries.groovy      |  3 +-
 13 files changed, 128 insertions(+), 42 deletions(-)

diff --git a/regression-test/data/external_table_p2/es/test_es_query.out 
b/regression-test/data/external_table_p2/es/test_es_query.out
index f1ba3d9d316..40eda41b791 100644
--- a/regression-test/data/external_table_p2/es/test_es_query.out
+++ b/regression-test/data/external_table_p2/es/test_es_query.out
@@ -132,6 +132,7 @@ value1      value2
 string1        text#1
 string2        text2
 string3        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_5_30 --
 string1        text#1
@@ -286,6 +287,7 @@ value1      value2
 string1        text#1
 string2        text2
 string3        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_6_30 --
 string1        text#1
@@ -397,10 +399,6 @@ I'm not null or empty
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_7_23 --
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string4 2022-08-08T20:10:10     text3_4*5       6       
2022-08-08T00:00        2022 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string_ignore_above_10  2022-08-08T20:10:10     
text_ignore_above_ [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
        \N      string2 2022-08-08T12:10:10     text2   4       
2022-08-08T00:00        2022-08-09 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
I'm not null or empty   \N      string3 2022-08-09T00:40:10     text3_4*5       
5       20 [...]
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_7_24 --
@@ -480,6 +478,7 @@ string1     text#1
 string2        text2
 string3        text3_4*5
 string4        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_7_36 --
 string1        text#1
@@ -601,10 +600,6 @@ I'm not null or empty
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_8_21 --
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string4 2022-08-08T20:10:10     text3_4*5       6       
2022-08-08T00:00        2022 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string_ignore_above_10  2022-08-08T20:10:10     
text_ignore_above_ [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
        \N      string2 2022-08-08T12:10:10     text2   4       
2022-08-08T00:00        2022-08-09 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
I'm not null or empty   \N      string3 2022-08-09T00:40:10     text3_4*5       
5       20 [...]
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_8_22 --
@@ -684,6 +679,7 @@ string1     text#1
 string2        text2
 string3        text3_4*5
 string4        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_8_34 --
 string1        text#1
@@ -842,6 +838,7 @@ value1      value2
 string1        text#1
 string2        text2
 string3        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_5_30 --
 string1        text#1
@@ -996,6 +993,7 @@ value1      value2
 string1        text#1
 string2        text2
 string3        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_6_30 --
 string1        text#1
@@ -1107,10 +1105,6 @@ I'm not null or empty
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_7_23 --
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string4 2022-08-08T20:10:10     text3_4*5       6       
2022-08-08T00:00        2022 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string_ignore_above_10  2022-08-08T20:10:10     
text_ignore_above_ [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
        \N      string2 2022-08-08T12:10:10     text2   4       
2022-08-08T00:00        2022-08-09 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
I'm not null or empty   \N      string3 2022-08-09T00:40:10     text3_4*5       
5       20 [...]
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_7_24 --
@@ -1190,6 +1184,7 @@ string1   text#1
 string2        text2
 string3        text3_4*5
 string4        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_7_36 --
 string1        text#1
@@ -1311,10 +1306,6 @@ I'm not null or empty
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_8_21 --
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string4 2022-08-08T20:10:10     text3_4*5       6       
2022-08-08T00:00        2022 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
\N      \N      string_ignore_above_10  2022-08-08T20:10:10     
text_ignore_above_ [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
        \N      string2 2022-08-08T12:10:10     text2   4       
2022-08-08T00:00        2022-08-09 [...]
-[1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      \N      
I'm not null or empty   \N      string3 2022-08-09T00:40:10     text3_4*5       
5       20 [...]
 [1, 0, 1, 1]   [1, -2, -3, 4]  ["2020-01-01", "2020-01-02"]    ["2020-01-01 
12:00:00", "2020-01-02 13:01:01"]  [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 
2, 3, 4]    [32768, 32769, -32769, -32770]  ["192.168.0.1", "127.0.0.1"]    
["a", "b", "c"] [-1, 0, 1, 2]   
[{"name":"Andy","age":18},{"name":"Tim","age":28}]      [1, 2, 3, 4]    [128, 
129, -129, -130]  ["d", "e", "f"] [0, 1, 2, 3]    
[{"last":"Smith","first":"John"},{"last":"White","first":"Alice"}]      debug   
\N      This string can be quite lengthy        string1 2022-08-08T20:10:10     
 [...]
 
 -- !sql_8_22 --
@@ -1394,6 +1385,7 @@ string1   text#1
 string2        text2
 string3        text3_4*5
 string4        text3_4*5
+string_ignore_above_10 text_ignore_above_10
 
 -- !sql_8_34 --
 string1        text#1
diff --git 
a/regression-test/data/external_table_p2/es/test_es_query_nereids.out 
b/regression-test/data/external_table_p2/es/test_es_query_nereids.out
index 0c9bed926df..0fb98abc0dd 100644
--- a/regression-test/data/external_table_p2/es/test_es_query_nereids.out
+++ b/regression-test/data/external_table_p2/es/test_es_query_nereids.out
@@ -7,6 +7,8 @@ string1 text#1  3.14    2022-08-08T00:00
 string2        text2   4.0     2022-08-08T00:00
 string3        text3_4*5       5.0     2022-08-08T00:00
 
+-- !source_date_mismatch --
+
 -- !sql64 --
 string2        text2   4.0     2022-08-08T00:00
 
diff --git 
a/regression-test/data/external_table_p2/es/test_es_query_predicate_correctness.out
 
b/regression-test/data/external_table_p2/es/test_es_query_predicate_correctness.out
index 922e6901a29..b768446ee2d 100644
--- 
a/regression-test/data/external_table_p2/es/test_es_query_predicate_correctness.out
+++ 
b/regression-test/data/external_table_p2/es/test_es_query_predicate_correctness.out
@@ -8,6 +8,7 @@ string1
 string2
 string3
 string4
+string_ignore_above_10
 
 -- !es7_regexp_alternation --
 string1
@@ -18,6 +19,7 @@ string1
 string2
 string3
 string4
+string_ignore_above_10
 
 -- !es7_is_null --
 3
@@ -37,6 +39,7 @@ string1
 string2
 string3
 string4
+string_ignore_above_10
 
 -- !es8_regexp_alternation --
 string1
@@ -47,6 +50,7 @@ string1
 string2
 string3
 string4
+string_ignore_above_10
 
 -- !es8_is_null --
 3
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_epoch_millis.groovy 
b/regression-test/suites/external_table_p2/es/test_es_epoch_millis.groovy
index 49dc1561eb1..eecd59c3dbf 100644
--- a/regression-test/suites/external_table_p2/es/test_es_epoch_millis.groovy
+++ b/regression-test/suites/external_table_p2/es/test_es_epoch_millis.groovy
@@ -72,7 +72,8 @@ suite("test_es_epoch_millis", "p2,external") {
         (9,'VALUE','1969-12-31 23:59:58'),(10,'VALUE','2023-03-04 02:08:48'),
         (11,'VALUE',null),(12,'VALUE','1970-01-01 
00:00:00'),(13,'VALUE',null),(14,'VALUE',null)"""
     def expected = "internal.${context.dbName}.es_epoch_millis_expected"
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     def originalZone = sql("show variables like 'time_zone'")[0][1]
     try {
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_mapping_boundaries.groovy 
b/regression-test/suites/external_table_p2/es/test_es_mapping_boundaries.groovy
index d3ff3bb8e26..72fa2e1a3b4 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_mapping_boundaries.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_mapping_boundaries.groovy
@@ -95,7 +95,8 @@ suite("test_es_mapping_boundaries", "p2,external") {
         "amount > 1 or ${nativeTerm}", "flag = true or ${nativeTerm}",
         "not (flag = true or ${nativeTerm})", "event_time = 1700000000000 or 
${nativeTerm}",
         "not (event_time = 1700000000000 or ${nativeTerm})", "event_time > 
1700000000000 or ${nativeTerm}"]
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     try {
         [true, false].each { docvalues ->
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_numeric_source_semantics.groovy
 
b/regression-test/suites/external_table_p2/es/test_es_numeric_source_semantics.groovy
index 5571132290d..fdb8dabd598 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_numeric_source_semantics.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_numeric_source_semantics.groovy
@@ -75,7 +75,8 @@ suite("test_es_numeric_source_semantics", "p2,external") {
         "c = cast(2.34 as float)", "c = cast(2.33984375 as float)",
         "c > cast(2.33984375 as float)", "c in (cast(2.34 as float), 
cast(-2.34 as float))"]
     def nativeTerm = """esquery(b, '{"term":{"b":2.25}}')"""
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     try {
         ["enabled", "disabled", "limited"].each { mode ->
diff --git a/regression-test/suites/external_table_p2/es/test_es_query.groovy 
b/regression-test/suites/external_table_p2/es/test_es_query.groovy
index 65cb837f867..0b28e9c825b 100644
--- a/regression-test/suites/external_table_p2/es/test_es_query.groovy
+++ b/regression-test/suites/external_table_p2/es/test_es_query.groovy
@@ -87,8 +87,34 @@ suite("test_es_query", "p2,external") {
         );
         """
 
+        def verifySourcePredicates = { String version ->
+            // Unfiltered source materialization keeps values omitted by 
ignore_above out of the oracle's index path.
+            def expected = 
"internal.${context.dbName}.es_query_source_expected"
+            sql "drop table if exists ${expected}"
+            sql """create table ${expected} (row_id int, test1 string, test2 
string)
+                distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
+            sql "insert into ${expected} select 0, test1, test2 from test1"
+            ["test1 like 'string%'", "test2 like 'text%'"].eachWithIndex { 
predicate, i ->
+                quickTest("es_${version}_source_like_${i}",
+                        "select test1,test2 from test1 where ${predicate} 
order by test1,test2",
+                        "select test1,test2 from ${expected} where 
${predicate} order by test1,test2")
+            }
+            if (version == "7" || version == "8") {
+                // An absent source field is NULL even when another document 
has an indexed value.
+                def levelExpected = 
"internal.${context.dbName}.es_query_level_expected"
+                sql "drop table if exists ${levelExpected}"
+                sql """create table ${levelExpected} (row_id int,test1 
string,level string)
+                    distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
+                sql "insert into ${levelExpected} select 0,test1,level from 
test1"
+                quickTest("es_${version}_source_level",
+                        "select test1,level from test1 where level = 'debug' 
order by test1",
+                        "select test1,level from ${levelExpected} where level 
= 'debug' order by test1")
+            }
+        }
+
         def query_catalogs = { ->
             sql """switch test_es_query_es5"""
+            verifySourcePredicates("5")
             order_qt_sql_5_02 """select * from test1 where test2='text#1'"""
             order_qt_sql_5_03 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
             order_qt_sql_5_04 """select * from test2_20220808 where 
substring(test2, 2) = 'ext2'"""
@@ -122,6 +148,7 @@ suite("test_es_query", "p2,external") {
             order_qt_sql_5_32 """select test7 from test2;"""
 
             sql """switch test_es_query_es6"""
+            verifySourcePredicates("6")
             // order_qt_sql_6_01 """show tables"""
             order_qt_sql_6_02 """select * from test1 where test2='text#1'"""
             order_qt_sql_6_03 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
@@ -176,6 +203,7 @@ suite("test_es_query", "p2,external") {
             assertTrue(containHide)
 
             sql """switch test_es_query_es7"""
+            verifySourcePredicates("7")
             // order_qt_sql_7_01 """show tables"""
             order_qt_sql_7_02 """select * from test1 where test2='text#1'"""
             order_qt_sql_7_03 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
@@ -239,6 +267,7 @@ suite("test_es_query", "p2,external") {
             order_qt_sql_7_50 """select * from test3_20231005"""
 
             sql """switch test_es_query_es8"""
+            verifySourcePredicates("8")
             order_qt_sql_8_01 """select * from test1 where test2='text#1'"""
             order_qt_sql_8_02 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
             order_qt_sql_8_03 """select c_bool[1], c_byte[1], c_short[1], 
c_integer[1], c_long[1], c_unsigned_long[1], c_float[1], c_half_float[1], 
c_double[1], c_scaled_float[1], c_date[1], c_datetime[1], c_keyword[1], 
c_text[1], c_ip[1], json_extract(c_person, '\$.[0]') from test1"""
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_query_nereids.groovy 
b/regression-test/suites/external_table_p2/es/test_es_query_nereids.groovy
index 87af5c46fec..14362d4839e 100644
--- a/regression-test/suites/external_table_p2/es/test_es_query_nereids.groovy
+++ b/regression-test/suites/external_table_p2/es/test_es_query_nereids.groovy
@@ -36,7 +36,8 @@ suite("test_es_query_nereids", "p2,external") {
                 "type"="es",
                 "elasticsearch.hosts"="http://${externalEnvIp}:$es_6_port";,
                 "elasticsearch.nodes_discovery"="false",
-                "elasticsearch.keyword_sniff"="true"
+                "elasticsearch.keyword_sniff"="true",
+                "enable_docvalue_scan"="false"
             );
         """
 
@@ -62,7 +63,20 @@ suite("test_es_query_nereids", "p2,external") {
 
         sql """switch es6_nereids"""
         order_qt_sql62 """select test1, test2, test3, test4 from test1 where 
test2='text#1'"""
-        order_qt_sql63 """select test1, test2, test3, test4 from 
test2_20220808 where test4='2022-08-08 08:00:00'"""
+        // Date-only source strings materialize at local midnight; an indexed 
UTC match cannot replace this predicate.
+        def expected = "internal.${context.dbName}.es_nereids_source_expected"
+        sql "drop table if exists ${expected}"
+        sql """create table ${expected} (row_id int,test1 string,test2 
string,test3 double,test4 datetimev2(0))
+            distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
+        sql "insert into ${expected} select 0,test1,test2,test3,test4 from 
test2_20220808"
+        ["2022-08-08 00:00:00", "2022-08-08 08:00:00"].eachWithIndex { date, i 
->
+            quickTest("source_date_${i}",
+                    "select test1,test2,test3,test4 from test2_20220808 where 
test4='${date}' order by test1",
+                    "select test1,test2,test3,test4 from ${expected} where 
test4='${date}' order by test1")
+        }
+        order_qt_sql63 """select test1, test2, test3, test4 from 
test2_20220808 where test4='2022-08-08 00:00:00'"""
+        order_qt_source_date_mismatch """select test1,test2,test3,test4 from 
test2_20220808
+            where test4='2022-08-08 08:00:00'"""
         order_qt_sql64 """select test1, test2, test3, test4 from 
test2_20220808 where substring(test2, 2) = 'ext2'"""
         // TODO(ftw): should open these annotation when nereids support ARRAY
         // order_qt_sql62 """select * from test1 where test2='text#1'"""
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_query_predicate_correctness.groovy
 
b/regression-test/suites/external_table_p2/es/test_es_query_predicate_correctness.groovy
index 58b7ce82d17..a65625ce7e8 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_query_predicate_correctness.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_query_predicate_correctness.groovy
@@ -15,10 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
-// Regression tests for ES connector predicate pushdown correctness.
-// Covers fixes:
-//   P0-4: REGEXP must generate ES 'regexp' query, not 'wildcard'
-//   P1-3: IS NULL must generate 'must_not exists', not 'term null'
+// Check SQL predicate results independently of whether ES index semantics 
permit pushdown.
 
 suite("test_es_query_predicate_correctness", "p2,external") {
     String enabled = context.config.otherConfigs.get("enableEsTest")
@@ -44,14 +41,29 @@ suite("test_es_query_predicate_correctness", "p2,external") 
{
             "enable_keyword_sniff"="true"
         );"""
 
+        def verifySourcePredicates = { String version ->
+            // SQL predicates apply to materialized source values even when ES 
omits their keyword index values.
+            def expected = 
"internal.${context.dbName}.es_predicate_source_expected"
+            sql "drop table if exists ${expected}"
+            sql """create table ${expected} (row_id int, test1 string, message 
string)
+                distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
+            sql "insert into ${expected} select 0,test1,message from test1"
+            ["test1 regexp 'string[12]'", "test1 regexp 'string.*'",
+             "test1 regexp 'string1|string3'", "test1 like 'string%'",
+             "message is null", "message is not null"].eachWithIndex { 
predicate, i ->
+                quickTest("es_${version}_source_predicate_${i}",
+                        "select test1 from test1 where ${predicate} order by 
test1",
+                        "select test1 from ${expected} where ${predicate} 
order by test1")
+            }
+        }
+
         // 
======================================================================
         // ES 7 tests
         // 
======================================================================
         sql """switch es7_pred_test"""
+        verifySourcePredicates("7")
 
-        // P0-4: REGEXP with character class [12] → ES 'regexp' query
-        // Before fix: generated 'wildcard' query, returning 0 rows
-        // After fix: generates 'regexp' query, correctly matching string1 and 
string2
+        // Character classes and alternation must retain SQL 
regular-expression semantics.
         order_qt_es7_regexp_charclass """select test1 from test1 where test1 
regexp 'string[12]' order by test1"""
 
         // REGEXP with dot-star
@@ -60,12 +72,10 @@ suite("test_es_query_predicate_correctness", "p2,external") 
{
         // REGEXP with alternation
         order_qt_es7_regexp_alternation """select test1 from test1 where test1 
regexp 'string1|string3' order by test1"""
 
-        // LIKE should still work (uses wildcard query, correct for LIKE)
+        // LIKE must include matching source values omitted by ignore_above.
         order_qt_es7_like """select test1 from test1 where test1 like 
'string%' order by test1"""
 
-        // P1-3: IS NULL / IS NOT NULL
-        // Before fix: IS NULL generated {term: {field: null}} returning 0 rows
-        // After fix: generates {bool: {must_not: [{exists: {field: ...}}]}}
+        // NULL predicates must agree with the source values used by the local 
oracle.
         order_qt_es7_is_null """select count(*) from test1 where message is 
null"""
         order_qt_es7_is_not_null """select count(*) from test1 where message 
is not null"""
         order_qt_es7_total_count """select count(*) from test1"""
@@ -74,6 +84,7 @@ suite("test_es_query_predicate_correctness", "p2,external") {
         // ES 8 tests (same queries, verifying both versions)
         // 
======================================================================
         sql """switch es8_pred_test"""
+        verifySourcePredicates("8")
 
         order_qt_es8_regexp_charclass """select test1 from test1 where test1 
regexp 'string[12]' order by test1"""
         order_qt_es8_regexp_dotstar """select test1 from test1 where test1 
regexp 'string.*' order by test1"""
@@ -97,10 +108,15 @@ suite("test_es_query_predicate_correctness", 
"p2,external") {
             contains "ES terminate_after: 5"
         }
 
-        // Case 2: LIMIT with fully-pushable predicate (equality on keyword 
field)
-        // After predicate pushdown, conjuncts should be empty → 
terminate_after active
+        // A raw keyword with ignore_above needs a residual, so it cannot 
terminate the ES scan early.
         explain {
             sql("select * from test1 where test1 = 'string1' limit 3")
+            notContains "ES terminate_after"
+        }
+
+        // An unchanged numeric docvalue remains eligible for predicate and 
LIMIT pushdown.
+        explain {
+            sql("select test3 from test1 where test3 = 3.14 limit 3")
             contains "ES terminate_after: 3"
         }
 
@@ -127,6 +143,12 @@ suite("test_es_query_predicate_correctness", 
"p2,external") {
 
         explain {
             sql("select * from test1 where test1 = 'string1' limit 3")
+            notContains "ES terminate_after"
+        }
+
+        // An unchanged numeric docvalue remains eligible for predicate and 
LIMIT pushdown.
+        explain {
+            sql("select test3 from test1 where test3 = 3.14 limit 3")
             contains "ES terminate_after: 3"
         }
 
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_scalar_materialization.groovy
 
b/regression-test/suites/external_table_p2/es/test_es_scalar_materialization.groovy
index a0616b5b6d6..bb0363c352b 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_scalar_materialization.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_scalar_materialization.groovy
@@ -100,7 +100,8 @@ suite("test_es_scalar_materialization", "p2,external") {
         distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
     sql "insert into es_retained_range_expected values 
(1,1,'miss'),(2,2,'miss'),(3,3,'miss'),(4,null,'miss'),(5,1,'hit')"
     def rangeExpected = "internal.${context.dbName}.es_retained_range_expected"
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     def originalZone = sql("show variables like 'time_zone'")[0][1]
     def originalRules = sql("show variables like 
'disable_nereids_expression_rules'")[0][1]
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_source_fallback_types.groovy
 
b/regression-test/suites/external_table_p2/es/test_es_source_fallback_types.groovy
index 034bbf6a995..d650ce858a5 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_source_fallback_types.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_source_fallback_types.groovy
@@ -26,7 +26,7 @@ suite("test_es_source_fallback_types", "p2,external") {
     String port = context.config.otherConfigs.get("es_8_port")
     assertTrue(port != null && !port.isEmpty(), "es_8_port must be configured")
     def endpoint = "http://${host}:${port}";
-    def request = { String method, String path, Object body = null ->
+    def request = { String method, String path, Object body = null, boolean 
probeSourceMode = false ->
         def connection = new URL("${endpoint}/${path}").openConnection()
         connection.requestMethod = method
         connection.connectTimeout = 10000
@@ -42,8 +42,18 @@ suite("test_es_source_fallback_types", "p2,external") {
                 return null
             }
             def text = (status < 400 ? connection.inputStream : 
connection.errorStream).getText("UTF-8")
+            def response = new JsonSlurper().parseText(text)
+            // Older ES8 images reject this mapping syntax; every other HTTP 
failure remains fatal.
+            if (probeSourceMode && status == 400
+                    && response.error?.type == "mapper_parsing_exception"
+                    && response.error?.caused_by?.reason ==
+                            "unknown parameter [mode] on mapper [_source] of 
type [null]") {
+                logger.info("The ES fixture does not support _source.mode; its 
syntax is not covered here, "
+                        + "using enabled:false")
+                return null
+            }
             assertTrue(status >= 200 && status < 300, "ES ${method} ${path}: 
${status} ${text}")
-            return new JsonSlurper().parseText(text)
+            return response
         } finally {
             connection.disconnect()
         }
@@ -70,9 +80,15 @@ suite("test_es_source_fallback_types", "p2,external") {
     ["flag", "mode"].each { kind ->
         def disabled = "doris_source_disabled_${kind}"
         request("DELETE", disabled)
-        request("PUT", disabled, [settings: settings, mappings: [
+        def created = request("PUT", disabled, [settings: settings, mappings: [
             _source: kind == "flag" ? [enabled: false] : [mode: "disabled"],
-            properties: [row_id: properties.row_id, a: properties.a, n: 
properties.n]]])
+            properties: [row_id: properties.row_id, a: properties.a, n: 
properties.n]]], kind == "mode")
+        if (created == null) {
+            // Both syntaxes disable the source. Keep the same row/alias 
checks on baseline ES8.
+            request("PUT", disabled, [settings: settings, mappings: [
+                _source: [enabled: false],
+                properties: [row_id: properties.row_id, a: properties.a, n: 
properties.n]]])
+        }
         request("PUT", "${disabled}/_doc/1?refresh=true", [row_id: 1, a: "ok", 
n: 1])
         request("POST", "_aliases", [actions: [[add: [index: index, alias: 
"doris_source_disabled_alias_${kind}"]],
             [add: [index: disabled, alias: 
"doris_source_disabled_alias_${kind}"]]]])
@@ -130,7 +146,8 @@ suite("test_es_source_fallback_types", "p2,external") {
     sql "insert into es_retained_not_expected values 
(1,null,'miss'),(2,1,'miss'),(3,2,'hit'),(4,2,'miss')"
     def notExpected = "internal.${context.dbName}.es_retained_not_expected"
     def originalNotRules = sql("show variables like 
'disable_nereids_expression_rules'")[0][1]
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     def originalZone = sql("show variables like 'time_zone'")[0][1]
     try {
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_source_semantics.groovy 
b/regression-test/suites/external_table_p2/es/test_es_source_semantics.groovy
index 831636f7003..4466a4ac77b 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_source_semantics.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_source_semantics.groovy
@@ -184,7 +184,8 @@ suite("test_es_source_semantics", "p2,external") {
         "sibling like '[%'", "sibling not in ('cat')", "not (sibling = 'cat')",
         "sibling = 'cat' or row_id = 1", "sibling = 'cat' and row_id > 0",
         "not (sibling = 'cat' and row_id = 1)"]
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     def originalBatch = sql("show variables like 'batch_size'")[0][1]
     try {
diff --git 
a/regression-test/suites/external_table_p2/es/test_es_source_value_boundaries.groovy
 
b/regression-test/suites/external_table_p2/es/test_es_source_value_boundaries.groovy
index e1b846b9faa..8810d6114bd 100644
--- 
a/regression-test/suites/external_table_p2/es/test_es_source_value_boundaries.groovy
+++ 
b/regression-test/suites/external_table_p2/es/test_es_source_value_boundaries.groovy
@@ -104,7 +104,8 @@ suite("test_es_source_value_boundaries", "p2,external") {
         distributed by hash(row_id) buckets 1 
properties("replication_num"="1")"""
     sql "insert into es_inherited_mapping_expected values 
(1,'VALUE',5,5),(2,'VALUE',5,5)"
     def mappingExpected = 
"internal.${context.dbName}.es_inherited_mapping_expected"
-    def originalV2 = sql("show variables like 'enable_file_scanner_v2'")[0][1]
+    // SHOW prefixes deprecated variable names; scalar access keeps the 
compatibility name stable.
+    def originalV2 = sql("SELECT @@enable_file_scanner_v2")[0][0]
     def originalParallel = sql("show variables like 
'enable_es_parallel_scroll'")[0][1]
     def originalZone = sql("show variables like 'time_zone'")[0][1]
     try {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to