asolimando commented on a change in pull request #2230:
URL: https://github.com/apache/calcite/pull/2230#discussion_r513793011
##########
File path: core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
##########
@@ -2517,6 +2517,18 @@ public static Object item(Object object, Object index) {
if (object instanceof List && index instanceof Number) {
return arrayItem((List) object, ((Number) index).intValue());
}
+ if (index instanceof Number) {
+ return structAccess(object, ((Number) index).intValue() - 1, ""); // 1
indexed
+ }
+ if (index instanceof String) {
Review comment:
At the moment I have the same tests added to `ReflectiveSchemaTest.java`
(`` and ``) and to `operator.iq` (as suggested by @julianhyde in the JIRA
ticket), there are pros/cons for both, but I think that finally `operator.iq`
wins since `ITEM` is an operator, what's your take?
----------------------------------------------------------------
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]