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 2020/08/08 10:05:31 UTC

[GitHub] [incubator-doris] hexian55 opened a new pull request #4300: fix doc value field NullPointerException

hexian55 opened a new pull request #4300:
URL: https://github.com/apache/incubator-doris/pull/4300


   ## Proposed changes
   
   issues:https://github.com/apache/incubator-doris/issues/4295
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [] Bugfix (non-breaking change which fixes an issue)
   
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [] I have create an issue on #ISSUE, and have described the bug/feature there in detail
   
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 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.

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] [incubator-doris] wuyunfeng commented on pull request #4300: [Doris On ES][Bug-Fix] Resolve NullPointerException when multi fields with `text` type

Posted by GitBox <gi...@apache.org>.
wuyunfeng commented on pull request #4300:
URL: https://github.com/apache/incubator-doris/pull/4300#issuecomment-671750420


   Thanks @hexian55 


----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [incubator-doris] wuyunfeng commented on a change in pull request #4300: fix doc value field NullPointerException

Posted by GitBox <gi...@apache.org>.
wuyunfeng commented on a change in pull request #4300:
URL: https://github.com/apache/incubator-doris/pull/4300#discussion_r467699429



##########
File path: fe/fe-core/src/test/java/org/apache/doris/external/elasticsearch/MappingPhaseTest.java
##########
@@ -102,4 +103,13 @@ public void testWorkFlow(@Injectable EsRestClient client) throws Exception{
         assertEquals("k2", searchContext1.docValueFieldsContext().get("k2"));
 
     }
+
+    @Test
+    public void testFieldMultAnalyzer() throws Exception {

Review comment:
       ```suggestion
       public void testMultTextFields() throws Exception {
   ```

##########
File path: fe/fe-core/src/test/java/org/apache/doris/external/elasticsearch/MappingPhaseTest.java
##########
@@ -102,4 +103,13 @@ public void testWorkFlow(@Injectable EsRestClient client) throws Exception{
         assertEquals("k2", searchContext1.docValueFieldsContext().get("k2"));
 
     }
+
+    @Test
+    public void testFieldMultAnalyzer() throws Exception {
+        MappingPhase mappingPhase = new MappingPhase(null);
+        EsTable esTableAfter7X = fakeEsTable("fake", "test", "_doc", columns);
+        SearchContext searchContext = new SearchContext(esTableAfter7X);
+        mappingPhase.resolveFields(searchContext, loadJsonFromFile("data/es/test_index_mapping_field_mult_analyzer.json"));
+        assertFalse(searchContext.docValueFieldsContext().containsKey("k3"));
+    }
 }

Review comment:
       add blank new line

##########
File path: fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/MappingPhase.java
##########
@@ -17,6 +17,7 @@
 
 package org.apache.doris.external.elasticsearch;
 
+import org.apache.commons.lang3.StringUtils;

Review comment:
       import order is not right

##########
File path: fe/fe-core/src/test/resources/data/es/test_index_mapping_field_mult_analyzer.json
##########
@@ -0,0 +1,23 @@
+{
+  "test": {
+    "mappings": {
+      "properties": {
+        "k1": {
+          "type": "long"
+        },
+        "k2": {
+          "type": "keyword"
+        },
+        "k3": {
+          "type": "text",
+          "fields": {
+            "ik": {
+              "type": "text",
+              "analyzer": "ik_max_word"
+            }
+          }
+        }
+      }
+    }
+  }
+}

Review comment:
       add blank new line

##########
File path: fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/MappingPhase.java
##########
@@ -156,6 +157,8 @@ private void resolveDocValuesFields(SearchContext searchContext, JSONObject fiel
             }
             docValueField = colName;
         }
-        searchContext.docValueFieldsContext().put(colName, docValueField);
+        if (StringUtils.isNotEmpty(docValueField)) {

Review comment:
       Can you add some comments for what you resolved




----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [incubator-doris] wuyunfeng merged pull request #4300: [Doris On ES][Bug-Fix] Resolve NullPointerException when multi fields with `text` type

Posted by GitBox <gi...@apache.org>.
wuyunfeng merged pull request #4300:
URL: https://github.com/apache/incubator-doris/pull/4300


   


----------------------------------------------------------------
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:
users@infra.apache.org



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