qidaye commented on code in PR #17502:
URL: https://github.com/apache/doris/pull/17502#discussion_r1127405859


##########
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java:
##########
@@ -169,13 +181,15 @@ public static List<Column> genColumnsFromEs(EsRestClient 
client, String indexNam
             boolean mappingEsId) {
         String mapping = client.getMapping(indexName);
         ObjectNode mappings = getMapping(mapping);
-        ObjectNode rootSchema = getRootSchema(mappings, mappingType);
-        return genColumnsFromEs(indexName, mappingType, rootSchema, 
mappingEsId);
+        // Get array_fields while removing _meta property.
+        List<String> arrayFields = new ArrayList<>();
+        ObjectNode rootSchema = getRootSchema(mappings, mappingType, 
arrayFields);

Review Comment:
   We can only get `array_fields` during the `getRootSchema` before the `_meta` 
field is removed.
   The suggestion changes are more like the style before the refactor, which 
will add ES version judgement in the `extractArrayFields` and will be 
duplicated with the logical in `getRootSchema`.
   You can check the old style via git history.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to