danny0405 commented on a change in pull request #2103:
URL: https://github.com/apache/calcite/pull/2103#discussion_r469812407
##########
File path: core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java
##########
@@ -66,7 +86,53 @@ protected boolean
throwValidationSignatureErrorOrReturnFalse(SqlCallBinding call
}
}
- protected void validateColumnNames(SqlValidator validator,
+ /**
+ * Validate the heading operands are in the form:
+ * (ROW, DESCRIPTOR, DESCRIPTOR ..., other params).
+ *
+ * @param callBinding The call binding
+ * @param descriptors The number of descriptors following the first operand
(e.g. the table)
+ *
+ * @return true if validation passes
+ */
+ protected boolean validateTableWithFollowingDescriptors(
+ SqlCallBinding callBinding, int descriptors) {
+ final SqlNode operand0 = callBinding.operand(0);
+ final SqlValidator validator = callBinding.getValidator();
+ final RelDataType type = validator.getValidatedNodeType(operand0);
+ if (type.getSqlTypeName() != SqlTypeName.ROW) {
+ return false;
+ }
+ for (int i = 1; i < descriptors + 1; i++) {
+ final SqlNode operand = callBinding.operand(i);
Review comment:
I think it is still straight-forward when it is the form `(ROW,
DESCRIPTOR ..., other params)`, in this form, we always assume that the
DESCRIPTOR has the column as the time column.
----------------------------------------------------------------
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]