You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/29 10:21:26 UTC

[GitHub] [doris] stalary opened a new pull request, #11340: [Feature] doe support array

stalary opened a new pull request, #11340:
URL: https://github.com/apache/doris/pull/11340

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   doe support array
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] wuyunfeng commented on a diff in pull request #11340: [Feature](array) doe support array

Posted by GitBox <gi...@apache.org>.
wuyunfeng commented on code in PR #11340:
URL: https://github.com/apache/doris/pull/11340#discussion_r939796674


##########
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java:
##########
@@ -132,16 +133,33 @@ public static boolean getBoolean(Map<String, String> properties, String name) th
         }
     }
 
-    /**
-     * Get mapping properties JSONObject.
-     **/
-    public static JSONObject getMappingProps(String sourceIndex, String indexMapping, String mappingType) {
+    public static List<String> getArrayFields(String indexMapping) {
+        JSONObject mappings = getMapping(indexMapping);
+        if (!mappings.containsKey("_meta")) {
+            return new ArrayList<>();
+        }
+        JSONObject meta = (JSONObject) mappings.get("_meta");
+        if (!meta.containsKey("doris")) {
+            return new ArrayList<>();
+        }
+        JSONObject dorisMeta = (JSONObject) meta.get("doris");

Review Comment:
   i do not think add the name `doris`to Ealsticsearch index meta  is suitable



-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] jackwener commented on pull request #11340: [Feature] doe support array

Posted by GitBox <gi...@apache.org>.
jackwener commented on PR #11340:
URL: https://github.com/apache/doris/pull/11340#issuecomment-1199273612

   Please use `[feature](array).....` pass the ci check.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] yiguolei merged pull request #11340: [Feature](array) doe support array

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #11340:
URL: https://github.com/apache/doris/pull/11340


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] stalary commented on a diff in pull request #11340: [Feature](array) doe support array

Posted by GitBox <gi...@apache.org>.
stalary commented on code in PR #11340:
URL: https://github.com/apache/doris/pull/11340#discussion_r939816612


##########
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsUtil.java:
##########
@@ -132,16 +133,33 @@ public static boolean getBoolean(Map<String, String> properties, String name) th
         }
     }
 
-    /**
-     * Get mapping properties JSONObject.
-     **/
-    public static JSONObject getMappingProps(String sourceIndex, String indexMapping, String mappingType) {
+    public static List<String> getArrayFields(String indexMapping) {
+        JSONObject mappings = getMapping(indexMapping);
+        if (!mappings.containsKey("_meta")) {
+            return new ArrayList<>();
+        }
+        JSONObject meta = (JSONObject) mappings.get("_meta");
+        if (!meta.containsKey("doris")) {
+            return new ArrayList<>();
+        }
+        JSONObject dorisMeta = (JSONObject) meta.get("doris");

Review Comment:
   In the automatic table creation scenario, users are required to create special mappings for the array fields. trino use it `JsonNode metaNode = nullSafeNode(mappings, "_meta");
   JsonNode metaProperties = nullSafeNode(metaNode, "trino");`



-- 
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-unsubscribe@doris.apache.org

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


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