beyond1920 opened a new pull request #2524:
URL: https://github.com/apache/calcite/pull/2524


   ## What is the purpose of the change
   
   This pr aims to support PARTITION BY clause for window table function with 
set semantics, especially for session window table function. 
   The new syntax is different with [current session window 
tvf](https://calcite.apache.org/docs/reference.html#session) syntax.
   In this pr, I support new syntax and old syntax for session window at the 
same time which means user could specify partition key in first operand by 
partition by clause or could specify partition key at key descriptor. If a 
session window both have those two partition keys, and they are different with 
each other, an exception would be thrown out.
   
   Besides, `PARTITION BY` clause only could be used in the first operand of 
Table Function which requires input table to be set semantics.
   
   ## Brief change log
   
     - Update `Parser.jj` to support partition by clause for table function 
with set semantics
     - Introduce an Enum class `InputSemantics` which contains two values: ROW, 
SET
     - Update `SqlWindowTableFunction` and it's child classes to add 
InputSemantics information 
     - Update `SqlSessionTableFunction` to check if a session window both have 
those two partition keys, and they are different with each other, an exception 
would be thrown out.
     - Introduce `SqlPartitionBy` which represents partition by clause.
     - Update `StandardConvertletTable` to add method 
`convertSessionWindowFunction` to convert `SqlSessionTableFunction` to RexNode. 
The result `RexNode` is compatible with old syntax.
   
   ## Verifying this change
   
     - Add tests in `SqlToRelConveterTest`, `SqlValidatorTest` and `stream.iq`
     
   ## Document
     - Update `referenced.md` to add demos for session window table function 
which use partition by clause.
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to