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

stalary 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 4ba93efc98 [Enhance](DOE)Support parse default es iso datetime string 
(#17412)
4ba93efc98 is described below

commit 4ba93efc98249950293d0b8278d03feac10aa4f2
Author: huangzhaowei <carlmartin...@gmail.com>
AuthorDate: Fri Mar 10 09:59:20 2023 +0800

    [Enhance](DOE)Support parse default es iso datetime string (#17412)
    
    * support parse default es iso datetime string
---
 be/src/exec/es/es_scroll_parser.cpp                | 57 ++++++++++++++++++----
 .../elasticsearch/scripts/data/data1.json          |  1 +
 .../elasticsearch/scripts/data/data2.json          |  1 +
 .../elasticsearch/scripts/data/data3.json          |  5 +-
 .../scripts/data/{data3.json => data4.json}        | 11 +++--
 .../elasticsearch/scripts/es_init.sh               | 21 +++++---
 .../elasticsearch/scripts/index/es7_test1.json     |  3 ++
 .../elasticsearch/scripts/index/es7_test2.json     |  3 ++
 .../doris/external/elasticsearch/EsUtil.java       |  7 +--
 regression-test/data/es_p0/test_es_query.out       | 46 +++++++++++++----
 regression-test/suites/es_p0/test_es_query.groovy  | 11 +++--
 11 files changed, 128 insertions(+), 38 deletions(-)

diff --git a/be/src/exec/es/es_scroll_parser.cpp 
b/be/src/exec/es/es_scroll_parser.cpp
index bf2f8f2732..06d0884db5 100644
--- a/be/src/exec/es/es_scroll_parser.cpp
+++ b/be/src/exec/es/es_scroll_parser.cpp
@@ -17,6 +17,7 @@
 
 #include "exec/es/es_scroll_parser.h"
 
+#include <cctz/time_zone.h>
 #include <gutil/strings/substitute.h>
 
 #include <boost/algorithm/string.hpp>
@@ -138,14 +139,6 @@ static const std::string INVALID_NULL_VALUE =
         return Status::RuntimeError(ss.str());                           \
     } while (false)
 
-#define PARSE_DATE(dt_val, col, type, is_date_str)                             
         \
-    if ((is_date_str &&                                                        
         \
-         !dt_val.from_date_str(static_cast<const 
std::string>(col.GetString()).c_str(), \
-                               col.GetStringLength())) ||                      
         \
-        (!is_date_str && !dt_val.from_unixtime(col.GetInt64() / 1000, 
"+08:00"))) {     \
-        RETURN_ERROR_IF_CAST_FORMAT_ERROR(col, type);                          
         \
-    }
-
 template <typename T>
 static Status get_int_value(const rapidjson::Value& col, PrimitiveType type, 
void* slot,
                             bool pure_doc_value) {
@@ -184,8 +177,54 @@ static Status get_date_value_int(const rapidjson::Value& 
col, PrimitiveType type
                                  RT* slot) {
     constexpr bool is_datetime_v1 = std::is_same_v<T, 
vectorized::VecDateTimeValue>;
     T dt_val;
-    PARSE_DATE(dt_val, col, type, is_date_str)
+    if (is_date_str) {
+        const std::string str_date = col.GetString();
+        int str_length = col.GetStringLength();
+        bool success = false;
+        // YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS+08:00 or 
2022-08-08T12:10:10.000Z
+        if (str_length > 19) {
+            std::chrono::system_clock::time_point tp;
+            const bool ok =
+                    cctz::parse("%Y-%m-%dT%H:%M:%E*S%Ez", str_date, 
cctz::utc_time_zone(), &tp);
+            if (ok) {
+                success = 
dt_val.from_unixtime(std::chrono::system_clock::to_time_t(tp),
+                                               cctz::local_time_zone().name());
+            }
+        } else if (str_length == 19) {
+            // YYYY-MM-DDTHH:MM:SS
+            if (*(str_date.c_str() + 10) == 'T') {
+                std::chrono::system_clock::time_point tp;
+                const bool ok =
+                        cctz::parse("%Y-%m-%dT%H:%M:%S", str_date, 
cctz::utc_time_zone(), &tp);
+                if (ok) {
+                    success = 
dt_val.from_unixtime(std::chrono::system_clock::to_time_t(tp),
+                                                   
cctz::local_time_zone().name());
+                }
+            } else {
+                // YYYY-MM-DD HH:MM:SS
+                success = dt_val.from_date_str(str_date.c_str(), str_length);
+            }
 
+        } else if (str_length == 13) {
+            // string long like "1677895728000"
+            int64_t time_long = std::atol(str_date.c_str());
+            if (time_long > 0) {
+                success = dt_val.from_unixtime(time_long / 1000, 
cctz::local_time_zone().name());
+            }
+        } else {
+            // YYYY-MM-DD or others
+            success = dt_val.from_date_str(str_date.c_str(), str_length);
+        }
+
+        if (!success) {
+            RETURN_ERROR_IF_CAST_FORMAT_ERROR(col, type);
+        }
+
+    } else {
+        if (!dt_val.from_unixtime(col.GetInt64() / 1000, 
cctz::local_time_zone().name())) {
+            RETURN_ERROR_IF_CAST_FORMAT_ERROR(col, type);
+        }
+    }
     if constexpr (is_datetime_v1) {
         if (type == TYPE_DATE) {
             dt_val.cast_to_date();
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data1.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data1.json
index 12bcbb0d5c..0302467868 100755
--- a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data1.json
+++ b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data1.json
@@ -6,6 +6,7 @@
   "test5": "2022-08-08 12:10:10",
   "test6": 1659931810000,
   "test7": 1659931810000,
+  "test8": "2022-08-08T12:10:10Z",
   "c_bool": [true, false, true, true],
   "c_byte": [1, -2, -3, 4],
   "c_short": [128, 129, -129, -130],
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data2.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data2.json
index 3b9ebdc6f2..c6f7d3e2f6 100755
--- a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data2.json
+++ b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data2.json
@@ -6,6 +6,7 @@
   "test5": "2022-08-09 12:10:10",
   "test6": 1660018210000,
   "test7": "2022-08-09 12:10:10",
+  "test8": 1660018210000,
   "c_bool": [true, false, true, true],
   "c_byte": [1, -2, -3, 4],
   "c_short": [128, 129, -129, -130],
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json
index 9c10c2cf2a..73631d8261 100755
--- a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json
+++ b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json
@@ -4,8 +4,9 @@
   "test3": 5.0,
   "test4": "2022-08-08",
   "test5": "2022-08-10 12:10:10",
-  "test6": 1660018210000,
-  "test7": "2022-08-10 12:10:10",
+  "test6": 1660104610000,
+  "test7": 1660104610000,
+  "test8": "2022-08-10T12:10:10",
   "c_bool": [true, false, true, true],
   "c_byte": [1, -2, -3, 4],
   "c_short": [128, 129, -129, -130],
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data4.json
similarity index 79%
copy from 
docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json
copy to docker/thirdparties/docker-compose/elasticsearch/scripts/data/data4.json
index 9c10c2cf2a..954ca884d6 100755
--- a/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data3.json
+++ b/docker/thirdparties/docker-compose/elasticsearch/scripts/data/data4.json
@@ -1,11 +1,12 @@
 {
-  "test1": "string3",
+  "test1": "string4",
   "test2": "text3_4*5",
-  "test3": 5.0,
+  "test3": 6.0,
   "test4": "2022-08-08",
-  "test5": "2022-08-10 12:10:10",
-  "test6": 1660018210000,
-  "test7": "2022-08-10 12:10:10",
+  "test5": "2022-08-11 12:10:10",
+  "test6": 1660191010000,
+  "test7": "2022-08-11 12:10:10",
+  "test8": "2022-08-11T12:10:10+09:00",
   "c_bool": [true, false, true, true],
   "c_byte": [1, -2, -3, 4],
   "c_short": [128, 129, -129, -130],
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/es_init.sh 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/es_init.sh
index 13947a064c..8ddb125e32 100755
--- a/docker/thirdparties/docker-compose/elasticsearch/scripts/es_init.sh
+++ b/docker/thirdparties/docker-compose/elasticsearch/scripts/es_init.sh
@@ -20,12 +20,13 @@
 # create index test1
 # shellcheck disable=SC2154
 curl "http://${ES_6_HOST}:9200/test1"; -H "Content-Type:application/json" -X 
PUT -d "@/mnt/scripts/index/es6_test1.json"
-# create index test2
+# create index test2_20220808
 curl "http://${ES_6_HOST}:9200/test2_20220808"; -H 
"Content-Type:application/json" -X PUT -d '@/mnt/scripts/index/es6_test2.json'
-# put data
+# put data for test1
 curl "http://${ES_6_HOST}:9200/test1/doc/1"; -H "Content-Type:application/json" 
-X POST -d '@/mnt/scripts/data/data1_es6.json'
 curl "http://${ES_6_HOST}:9200/test1/doc/2"; -H "Content-Type:application/json" 
-X POST -d '@/mnt/scripts/data/data2_es6.json'
 curl "http://${ES_6_HOST}:9200/test1/doc/3"; -H "Content-Type:application/json" 
-X POST -d '@/mnt/scripts/data/data3_es6.json'
+# put data for test2_20220808
 curl "http://${ES_6_HOST}:9200/test2_20220808/doc/1"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data1_es6.json'
 curl "http://${ES_6_HOST}:9200/test2_20220808/doc/2"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data2_es6.json'
 curl "http://${ES_6_HOST}:9200/test2_20220808/doc/3"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data3_es6.json'
@@ -36,15 +37,19 @@ curl "http://${ES_6_HOST}:9200/test2_20220808/doc/_mapping"; 
-H "Content-Type:app
 # es7
 # create index test1
 curl "http://${ES_7_HOST}:9200/test1"; -H "Content-Type:application/json" -X 
PUT -d "@/mnt/scripts/index/es7_test1.json"
-# create index test2
+# create index test2_20220808
 curl "http://${ES_7_HOST}:9200/test2_20220808"; -H 
"Content-Type:application/json" -X PUT -d '@/mnt/scripts/index/es7_test2.json'
-# put data
+# put data for tese1
 curl "http://${ES_7_HOST}:9200/test1/_doc/1"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data1.json'
 curl "http://${ES_7_HOST}:9200/test1/_doc/2"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data2.json'
 curl "http://${ES_7_HOST}:9200/test1/_doc/3"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data3.json'
+curl "http://${ES_7_HOST}:9200/test1/_doc/4"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data4.json'
+# put data for test2_20220808
 curl "http://${ES_7_HOST}:9200/test2_20220808/_doc/1"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data1.json'
 curl "http://${ES_7_HOST}:9200/test2_20220808/_doc/2"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data2.json'
 curl "http://${ES_7_HOST}:9200/test2_20220808/_doc/3"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data3.json'
+curl "http://${ES_7_HOST}:9200/test2_20220808/_doc/4"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data4.json'
+
 # put _meta for array
 curl "http://${ES_7_HOST}:9200/test1/_mapping"; -H 
"Content-Type:application/json" -X PUT -d "@/mnt/scripts/index/array_meta.json"
 curl "http://${ES_7_HOST}:9200/test2_20220808/_mapping"; -H 
"Content-Type:application/json" -X PUT -d "@/mnt/scripts/index/array_meta.json"
@@ -52,15 +57,19 @@ curl "http://${ES_7_HOST}:9200/test2_20220808/_mapping"; -H 
"Content-Type:applica
 # es8
 # create index test1
 curl "http://${ES_8_HOST}:9200/test1"; -H "Content-Type:application/json" -X 
PUT -d "@/mnt/scripts/index/es7_test1.json"
-# create index test2
+# create index test2_20220808
 curl "http://${ES_8_HOST}:9200/test2_20220808"; -H 
"Content-Type:application/json" -X PUT -d '@/mnt/scripts/index/es7_test2.json'
-# put data
+# put data for tese1
 curl "http://${ES_8_HOST}:9200/test1/_doc/1"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data1.json'
 curl "http://${ES_8_HOST}:9200/test1/_doc/2"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data2.json'
 curl "http://${ES_8_HOST}:9200/test1/_doc/3"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data3.json'
+curl "http://${ES_8_HOST}:9200/test1/_doc/4"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data4.json'
+# put data for test2_20220808
 curl "http://${ES_8_HOST}:9200/test2_20220808/_doc/1"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data1.json'
 curl "http://${ES_8_HOST}:9200/test2_20220808/_doc/2"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data2.json'
 curl "http://${ES_8_HOST}:9200/test2_20220808/_doc/3"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data3.json'
+curl "http://${ES_8_HOST}:9200/test2_20220808/_doc/4"; -H 
"Content-Type:application/json" -X POST -d '@/mnt/scripts/data/data4.json'
+
 # put _meta for array
 curl "http://${ES_8_HOST}:9200/test1/_mapping"; -H 
"Content-Type:application/json" -X PUT -d "@/mnt/scripts/index/array_meta.json"
 curl "http://${ES_8_HOST}:9200/test2_20220808/_mapping"; -H 
"Content-Type:application/json" -X PUT -d "@/mnt/scripts/index/array_meta.json"
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test1.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test1.json
index ebc4227a20..4f49a1db8b 100755
--- 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test1.json
+++ 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test1.json
@@ -35,6 +35,9 @@
         "type": "date",
         "format": "yyyy-MM-dd HH:mm:ss || epoch_millis"
       },
+      "test8": {
+        "type": "date"
+      },
       "c_bool": {
         "type": "boolean"
       },
diff --git 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test2.json 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test2.json
index 00143131d0..166331f5cc 100755
--- 
a/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test2.json
+++ 
b/docker/thirdparties/docker-compose/elasticsearch/scripts/index/es7_test2.json
@@ -38,6 +38,9 @@
         "type": "date",
         "format": "yyyy-MM-dd HH:mm:ss || epoch_millis"
       },
+      "test8": {
+        "type": "date"
+      },
       "c_bool": {
         "type": "boolean"
       },
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java 
b/fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java
index f5ba8ffc38..f9d3853ba7 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java
@@ -301,12 +301,13 @@ public class EsUtil {
             boolean bigIntFlag = false;
             for (String format : formats) {
                 // pre-check format
-                if (!ALLOW_DATE_FORMATS.contains(format)) {
+                String trimFormat = format.trim();
+                if (!ALLOW_DATE_FORMATS.contains(trimFormat)) {
                     column.setComment(
-                            "Elasticsearch type is date, format is " + format 
+ " not support, use String type");
+                            "Elasticsearch type is date, format is " + 
trimFormat + " not support, use String type");
                     return ScalarType.createStringType();
                 }
-                switch (format) {
+                switch (trimFormat) {
                     case "yyyy-MM-dd HH:mm:ss":
                         dateTimeFlag = true;
                         break;
diff --git a/regression-test/data/es_p0/test_es_query.out 
b/regression-test/data/es_p0/test_es_query.out
index cd691cc049..57ddfafd02 100644
--- a/regression-test/data/es_p0/test_es_query.out
+++ b/regression-test/data/es_p0/test_es_query.out
@@ -1,20 +1,35 @@
 -- 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]
+[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     2022-08-08T20: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]        
.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]        
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     2022-08-08T20: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]
+2022-08-08     2022-08-08T12:10:10     2022-08-08T12:10:10     
2022-08-08T04:10:10     2022-08-08T20:10:10
+2022-08-08     2022-08-09T12:10:10     2022-08-09T12:10:10     
2022-08-09T12:10:10     2022-08-09T12:10:10
+2022-08-08     2022-08-10T12:10:10     2022-08-10T12:10:10     
2022-08-10T04:10:10     2022-08-10T20:10:10
+2022-08-08     2022-08-11T12:10:10     2022-08-11T12:10:10     
2022-08-11T12:10:10     2022-08-11T11:10:10
+
+-- !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]        
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     2022-08-08T20: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]
+[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     2022-08-08T20:10:10     [1, -2, -3, 4]  [1, 0, 1, 1]    
[32768, 32769, -32769, -32770]
+
+-- !sql55 --
+2022-08-08     2022-08-08T12:10:10     2022-08-08T12:10:10     
2022-08-08T04:10:10     2022-08-08T20:10:10
+2022-08-08     2022-08-09T12:10:10     2022-08-09T12:10:10     
2022-08-09T12:10:10     2022-08-09T12:10:10
+2022-08-08     2022-08-10T12:10:10     2022-08-10T12:10:10     
2022-08-10T04:10:10     2022-08-10T20:10:10
+2022-08-08     2022-08-11T12:10:10     2022-08-11T12:10:10     
2022-08-11T12:10:10     2022-08-11T11:10:10
 
 -- !sql62 --
 [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 --
+[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
+[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
+[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]    string3 text3_4*5       5.0     2022-08-08T00:00
 
 -- !sql64 --
 [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
@@ -33,40 +48,53 @@ 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
 [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 --
-[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
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
 
 -- !sql73 --
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
+[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-09T12:10:10     
2022-08-09T12:10:10
+[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]    string3 text3_4*5       5.0     2022-08-08T00:00        
2022-08-10T12:10:10     1660104610000   2022-08-10T12:10:10     
2022-08-10T20:10:10
+[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]    string4 text3_4*5       6.0     2022-08-08T00:00        
2022-08-11T12:10:10     1660191010000   2022-08-11T12:10:10     
2022-08-11T11:10:10
 
 -- !sql74 --
-[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
+[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-09T12:10:10     
2022-08-09T12:10:10
 
 -- !sql75 --
 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}
+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-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}
+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
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
 
 -- !sql81 --
-[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
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
 
 -- !sql82 --
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
+[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-09T12:10:10     
2022-08-09T12:10:10
+[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]    string3 text3_4*5       5.0     2022-08-08T00:00        
2022-08-10T12:10:10     1660104610000   2022-08-10T12:10:10     
2022-08-10T20:10:10
+[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]    string4 text3_4*5       6.0     2022-08-08T00:00        
2022-08-11T12:10:10     1660191010000   2022-08-11T12:10:10     
2022-08-11T11:10:10
 
 -- !sql83 --
 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}
+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-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}
+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
+[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   2022-08-08T12:10:10     
2022-08-08T20:10:10
+
diff --git a/regression-test/suites/es_p0/test_es_query.groovy 
b/regression-test/suites/es_p0/test_es_query.groovy
index 2f7c811f45..f60a805691 100644
--- a/regression-test/suites/es_p0/test_es_query.groovy
+++ b/regression-test/suites/es_p0/test_es_query.groovy
@@ -83,6 +83,7 @@ suite("test_es_query", "p0") {
                 `c_person` array<text> NULL,
                 `test6` datetime NULL,
                 `test7` datetime NULL,
+                `test8` datetime NULL,
                 `c_byte` array<tinyint(4)> NULL,
                 `c_bool` array<boolean> NULL,
                 `c_integer` array<int(11)> NULL
@@ -98,6 +99,7 @@ suite("test_es_query", "p0") {
         """
         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"}}')"""
+        order_qt_sql53 """select test4,test5,test6,test7,test8 from test_v1 
order by test8"""
 
        sql """
             CREATE TABLE `test_v2` (
@@ -121,6 +123,7 @@ suite("test_es_query", "p0") {
                 `c_person` array<text> NULL,
                 `test6` datetimev2 NULL,
                 `test7` datetimev2 NULL,
+                `test8` datetimev2 NULL,
                 `c_byte` array<tinyint(4)> NULL,
                 `c_bool` array<boolean> NULL,
                 `c_integer` array<int(11)> NULL
@@ -136,7 +139,7 @@ suite("test_es_query", "p0") {
         """
         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"}}')"""
-
+        order_qt_sql55 """select test4,test5,test6,test7,test8 from test_v2 
order by test8"""
 
         sql """create catalog if not exists es6 with resource es6_resource;"""
         sql """create catalog if not exists es7 with resource es7_resource;"""
@@ -144,7 +147,7 @@ suite("test_es_query", "p0") {
         sql """switch es6"""
         // order_qt_sql61 """show tables"""
         order_qt_sql62 """select * from test1 where test2='text#1'"""
-        order_qt_sql63 """select * from test2_20220808 where 
test4='2022-08-08'"""
+        order_qt_sql63 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
         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"""
@@ -152,14 +155,14 @@ suite("test_es_query", "p0") {
         sql """switch es7"""
         // order_qt_sql71 """show tables"""
         order_qt_sql72 """select * from test1 where test2='text#1'"""
-        order_qt_sql73 """select * from test2_20220808 where 
test4='2022-08-08'"""
+        order_qt_sql73 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
         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_sql82 """select * from test2_20220808 where test4 >= 
'2022-08-08 00:00:00' and test4 < '2022-08-08 23:59:59'"""
         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"}}')"""


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


Reply via email to