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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 96a80c2a43af89d8980837c5fce51d44c87f9535
Author: Tiewei Fang <43782773+bepppo...@users.noreply.github.com>
AuthorDate: Fri Aug 4 11:28:30 2023 +0800

    [BugFix](Es Catalog) fix bug that es catalog will return error when query 
partial columns (#22423)
    
    Bug:
    When the value of some ES column is empty, querying these value in 
doc_values mode will receive an error.
    
    Reson:
    In doc values mode, these values are empty, We need to determine if the 
array is empty
---
 be/src/exec/es/es_scroll_parser.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/be/src/exec/es/es_scroll_parser.cpp 
b/be/src/exec/es/es_scroll_parser.cpp
index ebf5935203..de1209a00c 100644
--- a/be/src/exec/es/es_scroll_parser.cpp
+++ b/be/src/exec/es/es_scroll_parser.cpp
@@ -489,8 +489,10 @@ Status ScrollParser::fill_columns(const TupleDescriptor* 
tuple_desc,
             // because of reading value from _source, we can not process all 
json type and then just transfer the value to original string representation
             // this may be a tricky, but we can work around this issue
             std::string val;
-            if (pure_doc_value && !col.Empty()) {
-                if (!col[0].IsString()) {
+            if (pure_doc_value) {
+                if (col.Empty()) {
+                    break;
+                } else if (!col[0].IsString()) {
                     val = json_value_to_string(col[0]);
                 } else {
                     val = col[0].GetString();
@@ -588,8 +590,10 @@ Status ScrollParser::fill_columns(const TupleDescriptor* 
tuple_desc,
                 data.assign_from_double(col.GetDouble());
             } else {
                 std::string val;
-                if (pure_doc_value && !col.Empty()) {
-                    if (!col[0].IsString()) {
+                if (pure_doc_value) {
+                    if (col.Empty()) {
+                        break;
+                    } else if (!col[0].IsString()) {
                         val = json_value_to_string(col[0]);
                     } else {
                         val = col[0].GetString();


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

Reply via email to