danny0405 opened a new pull request #2052: URL: https://github.com/apache/calcite/pull/2052
The scope of SqlWindowTableFunction is special because all its operands (except the first) should have the fucntion's first operand's scope, the first operand is always an explicit table reference. While this is not the perfect solution, the more proper way is to refactor the CURSOR constructor, and always uses its queries scope. The current CURSOR has some problems: * It always has a type with name SqlTypeName#CURSOR, in the table function senario, it is hard to do a auxiliary fields type infernece; * It finally translates as a invocation with format "cast($0): CURSOR", the '$0' means the first input, which is a wrong translation; * It does not belong to the SQL standard. A 'TABLE' constructor may be a good substitution. ---------------------------------------------------------------- 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: us...@infra.apache.org