mihaibudiu commented on code in PR #4729:
URL: https://github.com/apache/calcite/pull/4729#discussion_r2673541148


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlItemOperator.java:
##########
@@ -163,6 +164,20 @@ private static SqlSingleOperandTypeChecker 
getChecker(SqlCallBinding callBinding
       if (sqlTypeName == SqlTypeName.VARIANT) {
         // Allow any key type to be used when the map keys have a VARIANT type
         return OperandTypes.family(SqlTypeFamily.ANY);
+      } else if (sqlTypeName == SqlTypeName.ROW) {
+        // Check that the type of the argument is exactly the key type
+        return new SqlSingleOperandTypeChecker() {
+          @Override public boolean checkSingleOperandType(
+              SqlCallBinding callBinding, SqlNode operand,
+              int iFormalOperand, boolean throwOnFailure) {
+            RelDataType operandType = callBinding.getOperandType(0);
+            return operandType.equals(keyType);

Review Comment:
   Yes, this was wrong, and not throwing when throwOnFailure was also wrong.
   Thanks for catching this!
   



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

Reply via email to