kgyrtkirk commented on code in PR #15964:
URL: https://github.com/apache/druid/pull/15964#discussion_r1502171796


##########
sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:
##########
@@ -59,11 +59,13 @@ public class ArrayOverlapOperatorConversion extends 
BaseExpressionDimFilterOpera
               "'ARRAY_OVERLAP(array, array)'",
               OperandTypes.or(
                   OperandTypes.family(SqlTypeFamily.ARRAY),
-                  OperandTypes.family(SqlTypeFamily.STRING)
+                  OperandTypes.family(SqlTypeFamily.STRING),
+                  OperandTypes.family(SqlTypeFamily.NUMERIC)

Review Comment:
   it seems like its possible to possible to specify operands with different 
types
   could you add some tests like:
   ```
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(l1||'.1', ARRAY[2.1, 7.1]) 
LIMIT 5
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(l1||'.1', ARRAY[2.1, 7.1]) 
LIMIT 5
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(ARRAY[l2], ARRAY[2, 7]) 
LIMIT 5
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(ARRAY['x',l2||''], 
ARRAY['2', '7']) LIMIT 5
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(ARRAY[2,7], ARRAY['2', 
'7']) LIMIT 5
   SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(ARRAY[2,7], 
ARRAY[2.0,7.0]) LIMIT 5
   ```
   
   it seems like type mismatch was already there in some cases 
(`array<int>,array<string>)` - would it be possible to reject invalid cases?



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