imay commented on a change in pull request #2297: Enhance doris on es error 
message 
URL: https://github.com/apache/incubator-doris/pull/2297#discussion_r350576161
 
 

 ##########
 File path: be/src/exec/es/es_scroll_parser.cpp
 ##########
 @@ -222,8 +270,22 @@ Status ScrollParser::fill_tuple(const TupleDescriptor* 
tuple_desc,
             case TYPE_CHAR:
             case TYPE_VARCHAR: {
                 RETURN_ERROR_IF_COL_IS_ARRAY(col, type);
-                RETURN_ERROR_IF_COL_IS_NOT_STRING(col, type);
-
+                // sometimes elasticsearch user post some not-string value to 
Elasticsearch Index.
+                // 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 workaround this issue
+                if (!col.IsString()) {
+                    std::string string_representation = 
json_value_to_string(col);
+                    char* str_buffer = 
reinterpret_cast<char*>(tuple_pool->try_allocate_unaligned(string_representation.length()));
+                    if (UNLIKELY(str_buffer == NULL)) {
 
 Review comment:
   This logic is the same with code below, it is better to reuse code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to