asolimando commented on a change in pull request #2230:
URL: https://github.com/apache/calcite/pull/2230#discussion_r512594390



##########
File path: core/src/main/java/org/apache/calcite/sql/fun/SqlItemOperator.java
##########
@@ -115,7 +115,8 @@ private SqlSingleOperandTypeChecker 
getChecker(SqlCallBinding callBinding) {
 
   @Override public String getAllowedSignatures(String name) {
     return "<ARRAY>[<INTEGER>]\n"
-        + "<MAP>[<VALUE>]";
+        + "<MAP>[<VALUE>]\n"
+        + "<ROW>[<CHARACTER>|<INTEGER>]";
   }

Review comment:
       `<MAP>[< CHARACTER >]` is only correct when we have a `MAP<CHARACTER, 
_>` collection, which is not always the case. 
   
   That signature is static, so the concrete type is not known, the best we can 
do is to use a "placeholder" for the right type, being it `<VALUE>` or `<KEY>` 
or something else.
   
   To make it clearer, consider that we could legally write a query like 
`select map_field[select ...] ...`, provided that the inner `select ...` 
returns an expression of type `K`, for a `map_field` of type `MAP<K, _>`.




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

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


Reply via email to