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 2023/01/04 06:06:37 UTC

[GitHub] [doris] englefly opened a new pull request, #15595: [fix](nereids)type coercion: in-pred handle null literal bug

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

   # Proposed changes
   1 in (2, null)
   in type coercion rewrite, nereids cast null to tiny int. This is wrong.
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## 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 (If Yes, please explain WHY)
       - [ ] 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] hello-stephen commented on pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #15595:
URL: https://github.com/apache/doris/pull/15595#issuecomment-1370538927

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 35.75 seconds
    load time: 644 seconds
    storage size: 17123042995 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230104063948_clickbench_pr_73243.html


-- 
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] morrySnow commented on a diff in pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rewrite/rules/TypeCoercion.java:
##########
@@ -149,7 +150,8 @@ public Expression visitInPredicate(InPredicate inPredicate, ExpressionRewriteCon
         InPredicate newInPredicate = inPredicate.withChildren(rewrittenChildren);
 
         if (newInPredicate.getOptions().stream().map(Expression::getDataType)
-                .allMatch(dt -> dt.equals(newInPredicate.getCompareExpr().getDataType()))) {
+                .allMatch(dt -> dt.equals(NullType.INSTANCE)
+                        || dt.equals(newInPredicate.getCompareExpr().getDataType()))) {
             return newInPredicate;
         }
         Optional<DataType> optionalCommonType = TypeCoercionUtils.findWiderCommonType(newInPredicate.children()

Review Comment:
   should also filter null type, when we do cast



-- 
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] englefly commented on a diff in pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rewrite/rules/TypeCoercion.java:
##########
@@ -149,7 +150,8 @@ public Expression visitInPredicate(InPredicate inPredicate, ExpressionRewriteCon
         InPredicate newInPredicate = inPredicate.withChildren(rewrittenChildren);
 
         if (newInPredicate.getOptions().stream().map(Expression::getDataType)
-                .allMatch(dt -> dt.equals(newInPredicate.getCompareExpr().getDataType()))) {
+                .allMatch(dt -> dt.equals(NullType.INSTANCE)
+                        || dt.equals(newInPredicate.getCompareExpr().getDataType()))) {
             return newInPredicate;
         }
         Optional<DataType> optionalCommonType = TypeCoercionUtils.findWiderCommonType(newInPredicate.children()

Review Comment:
   change castIfNotSameType() to castIfNotSameTypeAndNotNull().
   



-- 
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] morrySnow closed pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug

Posted by GitBox <gi...@apache.org>.
morrySnow closed pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug
URL: https://github.com/apache/doris/pull/15595


-- 
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] morrySnow commented on pull request #15595: [fix](nereids)type coercion: in-pred handle null literal bug

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

   fix by #15880 


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