gianm commented on code in PR #16388:
URL: https://github.com/apache/druid/pull/16388#discussion_r1596919609


##########
sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java:
##########
@@ -559,8 +572,16 @@ private RexNode makeMatchCondition(
         } else {
           return SearchOperatorConversion.makeIn(
               reverseLookupKey.arg,
-              stringsToRexNodes(reversedMatchValues, rexBuilder),
+              reversedMatchValues,
+              rexBuilder.getTypeFactory()
+                        .createTypeWithNullability(
+                            
rexBuilder.getTypeFactory().createSqlType(SqlTypeName.VARCHAR),
+                            true
+                        ),
               reverseLookupKey.negate,
+
+              // Use regular equals, or SCALAR_IN_ARRAY, depending on 
inFunctionThreshold.
+              reversedMatchValues.size() >= 
plannerContext.queryContext().getInFunctionThreshold(),

Review Comment:
   Ah, it's like this because different usages of this method use different 
thresholds. Sometimes it's the `inFunctionThreshold`, sometimes it's the 
`inFunctionExprThreshold`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to