amaliujia commented on a change in pull request #1587: [CALCITE-3272] Support
TUMBLE as Table Valued Function including an enumerable implementation,
stream.iq and DESCRIPTOR
URL: https://github.com/apache/calcite/pull/1587#discussion_r358408683
##########
File path:
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
##########
@@ -2285,6 +2285,7 @@ private SqlNode registerFrom(
case VALUES:
case WITH:
case OTHER_FUNCTION:
+ case TUMBLE:
Review comment:
Ok. So I think the suggestion to use `COLLECITON_TABLE` is to address the
special handling in validator. I gave it a try to make `TUMBLE`'s SqlKind as
`COLLECITON_TABLE` and found
1. most of the special handling for TUMBLE is not needed
2. except for
```
if (rexCall.getKind() == SqlKind.TUMBLE) {
inputs.add(convertSelect((SqlSelect) call.getOperandList().get(0),
false));
} else {
inputs = bb.retrieveCursors();
}
```
as inputs is still empty by using `COLLECITON_TABLE`.
3. In enumerable implementation, string match is used to check if it is
tumbling case as we no longer can use SqlKind to check it, which makes code a
little longer.
Because the inputs is still empty problem, I incline to still use
SqlKind.TUMBLE.
----------------------------------------------------------------
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]
With regards,
Apache Git Services