Hi community, CALCITE-4865 is first subtask of CALCITE-4864. This Jira aims to extend existed Table function in order to support Polymorphic Table Function which is introduced as the part of ANSI SQL 2016.
Please help review the pr, it would be very appreciated. Thanks a lot. The brief change logs of the PR are: - Update `Parser.jj` to support partition by clause and order by clause for input table with set semantics of PTF - Introduce `TableCharacteristics` which contains three characteristics of input table of table function - Update `SqlTableFunction` to add a method `tableCharacteristics`, the method returns the table characteristics for the ordinal-th argument to this table function. Default return value is Optional.empty which means the ordinal-th argument is not table. - Introduce `SqlSetSemanticsTable` which represents input table with set semantics of Table Function, its `SqlKind` is `SET_SEMANTICS_TABLE` - Updates `SqlValidatorImpl` to validate only set semantic table of Table Function could have partition by and order by clause - Update `SqlToRelConverter#substituteSubQuery` to parse subQuery which represents set semantics table. PR: https://github.com/apache/calcite/pull/2606 JIRA: https://issues.apache.org/jira/browse/CALCITE-4865 Parent JARA: PR: https://issues.apache.org/jira/browse/CALCITE-4864 Best, Jing Zhang