asolimando commented on a change in pull request #2230:
URL: https://github.com/apache/calcite/pull/2230#discussion_r512557163
##########
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:
Ah, sorry, now I get it.
Consider that `MAP` is a shortcut for ` MAP<K,V>`, so `<MAP>[<VALUE>]`
should be read as `<MAP>[<K>]`, since we will finally be accessing the `MAP`
values via keys, which can have type other than `CHARACTER`(check
[SqlItemOperator.java#101](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/fun/SqlItemOperator.java#L101),
for instance).
This said, probably `<MAP>[<KEY>]` or even `<MAP>[<KEY_VALUE>]` seem more
clear than `<MAP>[<VALUE>]`, I could change that if you agree on that.
----------------------------------------------------------------
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]