You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/12/10 09:34:32 UTC

[GitHub] [druid] LakshSingla commented on a change in pull request #11923: Fix incorrect type conversion in DruidLogicalValueRule

LakshSingla commented on a change in pull request #11923:
URL: https://github.com/apache/druid/pull/11923#discussion_r766513930



##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java
##########
@@ -93,24 +94,28 @@ public void onMatch(RelOptRuleCall call)
    *
    * @throws IllegalArgumentException for unsupported types
    */
+  @Nullable
   @VisibleForTesting
   static Object getValueFromLiteral(RexLiteral literal, PlannerContext plannerContext)
   {
+    if (RexLiteral.value(literal) == null) {

Review comment:
       Good catch, I checked and as per your comment this is an edge case that changes with this `if` condition.
   More specifically, iff `literal.getType.getSqlTypeName() == BOOELAN`, `literal.getSqlTypeName() =/= BOOLEAN` and `literal.value == null`, then we would exit early from the code and return null, but the older method should be returning `false`.




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

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



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