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

yiguolei 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 f0bd002911 [fix](DOE) Fix esquery not working (#17566)
f0bd002911 is described below

commit f0bd002911ec7ed758a02a48820e769fc7b147ca
Author: qiye <jianliang5...@gmail.com>
AuthorDate: Wed Mar 8 21:51:17 2023 +0800

    [fix](DOE) Fix esquery not working (#17566)
    
    Function esquery does not work because there is a problem parsing the first 
parameter type.
    The first parameter, which is SlotRef, will be cast to CastExpr. This will 
cause error while generating ES DSL.
    Add more types to adapt esquery function.
---
 gensrc/script/doris_builtins_functions.py         | 25 ++++++++
 regression-test/data/es_p0/test_es_query.out      | 75 ++++++++++++-----------
 regression-test/suites/es_p0/test_es_query.groovy |  9 ++-
 3 files changed, 72 insertions(+), 37 deletions(-)

diff --git a/gensrc/script/doris_builtins_functions.py 
b/gensrc/script/doris_builtins_functions.py
index 9e0b32fc6a..f14bb62688 100644
--- a/gensrc/script/doris_builtins_functions.py
+++ b/gensrc/script/doris_builtins_functions.py
@@ -1226,7 +1226,32 @@ visible_functions = [
     [['coalesce'], 'VARCHAR', ['VARCHAR', '...'], 'CUSTOM'],
     [['coalesce'], 'STRING', ['STRING', '...'], 'CUSTOM'],
 
+    # esquery's first arg is suitable for all types
+    [['esquery'], 'BOOLEAN', ['BOOLEAN', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['TINYINT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['SMALLINT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['INT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['BIGINT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['LARGEINT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['FLOAT', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DOUBLE', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DATE', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DATETIME', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['CHAR', 'VARCHAR'], ''],
     [['esquery'], 'BOOLEAN', ['VARCHAR', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['JSONB', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DECIMALV2', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DECIMAL32', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DECIMAL64', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DECIMAL128', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['TIME', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DATEV2', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['DATETIMEV2', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['TIMEV2', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['ARRAY', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['MAP', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['STRING', 'VARCHAR'], ''],
+    [['esquery'], 'BOOLEAN', ['VARIANT', 'VARCHAR'], ''],
 
     # String builtin functions
     [['substr', 'substring'], 'VARCHAR', ['VARCHAR', 'INT'], 
'ALWAYS_NULLABLE'],
diff --git a/regression-test/data/es_p0/test_es_query.out 
b/regression-test/data/es_p0/test_es_query.out
index 72c21f8acf..cd691cc049 100644
--- a/regression-test/data/es_p0/test_es_query.out
+++ b/regression-test/data/es_p0/test_es_query.out
@@ -1,67 +1,72 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !sql51 --
+[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
.14     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
+
 -- !sql52 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
3.14    [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
+[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
.14     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
 
--- !sql51 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
3.14    [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
+-- !sql53 --
+[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
.14     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
+
+-- !sql54 --
+[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08T12:10:10     text#1  [2020-01-01, 2020-01-02]        
.14     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08T12:10:10     
2022-08-08T12:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, 
-32770]
 
 -- !sql62 --
-['2020-01-01 12:00:00', '2020-01-02 13:01:01'] [-1, 0, 1, 2]   [0, 1, 2, 3]    
['d', 'e', 'f'] [128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 
[1, 2, 3, 4]    2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] [1, -2, -3, 4]  [1, 0, 
1, 1]    [32768, 32769, -32769, -32770]
+[1, 0, 1, 1]   [1, -2, -3, 4]  [2020-01-01 00:00:00, 2020-01-02 00:00:00]      
['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]    string1 text#1  3.14    2022-08-08T00:00
 
 -- !sql63 --
-['2020-01-01 12:00:00', '2020-01-02 13:01:01'] [-1, 0, 1, 2]   [0, 1, 2, 3]    
['d', 'e', 'f'] [128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 
[1, 2, 3, 4]    2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] [1, -2, -3, 4]  [1, 0, 
1, 1]    [32768, 32769, -32769, -32770]
-['2020-01-01 12:00:00', '2020-01-02 13:01:01'] [-1, 0, 1, 2]   [0, 1, 2, 3]    
['d', 'e', 'f'] [128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string2 
[1, 2, 3, 4]    2022-08-08      text2   [2020-01-01, 2020-01-02]        4.0     
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] [1, -2, -3, 4]  [1, 0, 
1, 1]    [32768, 32769, -32769, -32770]
-['2020-01-01 12:00:00', '2020-01-02 13:01:01'] [-1, 0, 1, 2]   [0, 1, 2, 3]    
['d', 'e', 'f'] [128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string3 
[1, 2, 3, 4]    2022-08-08      text3_4*5       [2020-01-01, 2020-01-02]        
5.0     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] [1, -2, -3, 4]  [1, 0, 
1, 1]    [32768, 32769, -32769, -32770]
 
 -- !sql64 --
-['2020-01-01 12:00:00', '2020-01-02 13:01:01'] [-1, 0, 1, 2]   [0, 1, 2, 3]    
['d', 'e', 'f'] [128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string2 
[1, 2, 3, 4]    2022-08-08      text2   [2020-01-01, 2020-01-02]        4.0     
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] [1, -2, -3, 4]  [1, 0, 
1, 1]    [32768, 32769, -32769, -32770]
+[1, 0, 1, 1]   [1, -2, -3, 4]  [2020-01-01 00:00:00, 2020-01-02 00:00:00]      
['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]    string2 text2   4.0     2022-08-08T00:00
 
 -- !sql65 --
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
 
 -- !sql66 --
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01      2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1       1       1       
2020-01-01T00:00        2020-01-01 12:00:00     a       d       192.168.0.1     
{"name":"Andy","age":18}
+
+-- !sql67 --
+[1, 0, 1, 1]   [1, -2, -3, 4]  [2020-01-01 00:00:00, 2020-01-02 00:00:00]      
['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]    string1 text#1  3.14    2022-08-08T00:00
 
 -- !sql72 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08      
2022-08-08      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
+[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]    string1 text#1  3.14    2022-08-08T00:00        
2022-08-08T12:10:10     1659931810000   1659931810000
 
 -- !sql73 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08      
2022-08-08      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string2 [1, 2, 3, 4]    
2022-08-08      2022-08-09      text2   [2020-01-01, 2020-01-02]        4.0     
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-09      
2022-08-09      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string3 [1, 2, 3, 4]    
2022-08-08      2022-08-10      text3_4*5       [2020-01-01, 2020-01-02]        
5.0     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-09      
2022-08-10      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
 
 -- !sql74 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string2 [1, 2, 3, 4]    
2022-08-08      2022-08-09      text2   [2020-01-01, 2020-01-02]        4.0     
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-09      
2022-08-09      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
+[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]    string2 text2   4.0     2022-08-08T00:00        
2022-08-09T12:10:10     1660018210000   2022-08-09 12:10:10
 
 -- !sql75 --
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
 
 -- !sql76 --
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+
+-- !sql77 --
+[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]    string1 text#1  3.14    2022-08-08T00:00        
2022-08-08T12:10:10     1659931810000   1659931810000
 
 -- !sql81 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08      
2022-08-08      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
+[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]    string1 text#1  3.14    2022-08-08T00:00        
2022-08-08T12:10:10     1659931810000   1659931810000
 
 -- !sql82 --
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string1 [1, 2, 3, 4]    
2022-08-08      2022-08-08      text#1  [2020-01-01, 2020-01-02]        3.14    
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-08      
2022-08-08      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string2 [1, 2, 3, 4]    
2022-08-08      2022-08-09      text2   [2020-01-01, 2020-01-02]        4.0     
[1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-09      
2022-08-09      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
-[2020-01-01, 2020-01-02]       [-1, 0, 1, 2]   [0, 1, 2, 3]    ['d', 'e', 'f'] 
[128, 129, -129, -130]  ['192.168.0.1', '127.0.0.1']    string3 [1, 2, 3, 4]    
2022-08-08      2022-08-10      text3_4*5       [2020-01-01, 2020-01-02]        
5.0     [1, 2, 3, 4]    [1, 1.1, 1.2, 1.3]      [1, 2, 3, 4]    ['a', 'b', 'c'] 
['{"name":"Andy","age":18}', '{"name":"Tim","age":28}'] 2022-08-09      
2022-08-10      [1, -2, -3, 4]  [1, 0, 1, 1]    [32768, 32769, -32769, -32770]
 
 -- !sql83 --
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
 
 -- !sql84 --
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
-true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01      a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
+true   1       128     32768   -1      0       1.0     1.0     1.0     1.0     
2020-01-01      2020-01-01T12:00        a       d       192.168.0.1     
{"name":"Andy","age":18}
 
+-- !sql85 --
+[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]    string1 text#1  3.14    2022-08-08T00:00        
2022-08-08T12:10:10     1659931810000   1659931810000
diff --git a/regression-test/suites/es_p0/test_es_query.groovy 
b/regression-test/suites/es_p0/test_es_query.groovy
index 9127c5e75f..2f7c811f45 100644
--- a/regression-test/suites/es_p0/test_es_query.groovy
+++ b/regression-test/suites/es_p0/test_es_query.groovy
@@ -96,7 +96,8 @@ suite("test_es_query", "p0") {
                 "http_ssl_enabled"="false"
             );
         """
-        order_qt_sql52 """select * from test_v1 where test2='text#1'"""
+        order_qt_sql51 """select * from test_v1 where test2='text#1'"""
+        order_qt_sql52 """select * from test_v1 where esquery(test2, 
'{"match":{"test2":"text#1"}}')"""
 
        sql """
             CREATE TABLE `test_v2` (
@@ -133,7 +134,8 @@ suite("test_es_query", "p0") {
                 "http_ssl_enabled"="false"
             );
         """
-        order_qt_sql51 """select * from test_v2 where test2='text#1'"""
+        order_qt_sql53 """select * from test_v2 where test2='text#1'"""
+        order_qt_sql54 """select * from test_v2 where esquery(test2, 
'{"match":{"test2":"text#1"}}')"""
 
 
         sql """create catalog if not exists es6 with resource es6_resource;"""
@@ -146,6 +148,7 @@ suite("test_es_query", "p0") {
         order_qt_sql64 """select * from test2_20220808 where substring(test2, 
2) = 'ext2'"""
         order_qt_sql65 """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], c_person[1] from test1"""
         order_qt_sql66 """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], c_person[1] from test2_20220808"""
+        order_qt_sql67 """select * from test1 where esquery(test2, 
'{"match":{"test2":"text#1"}}')"""
         sql """switch es7"""
         // order_qt_sql71 """show tables"""
         order_qt_sql72 """select * from test1 where test2='text#1'"""
@@ -153,11 +156,13 @@ suite("test_es_query", "p0") {
         order_qt_sql74 """select * from test2_20220808 where substring(test2, 
2) = 'ext2'"""
         order_qt_sql75 """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], c_person[1] from test1"""
         order_qt_sql76 """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], c_person[1] from test2"""
+        order_qt_sql77 """select * from test1 where esquery(test2, 
'{"match":{"test2":"text#1"}}')"""
         sql """switch es8"""
         order_qt_sql81 """select * from test1 where test2='text#1'"""
         order_qt_sql82 """select * from test2_20220808 where 
test4='2022-08-08'"""
         order_qt_sql83 """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], c_person[1] from test1"""
         order_qt_sql84 """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], c_person[1] from test2"""
+        order_qt_sql85 """select * from test1 where esquery(test2, 
'{"match":{"test2":"text#1"}}')"""
 
 
         sql """drop catalog if exists es6;"""


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to