godfreyhe opened a new pull request #10694: [FLINK-15381] [table-planner-blink] 
correct collation derive logic on RelSubset in RelMdCollation
URL: https://github.com/apache/flink/pull/10694
 
 
   
   
   ## What is the purpose of the change
   
   *sql: `select cast(a as int), cast(b as varchar) from (values (3, 'c')) 
T(a,b)` will fail, 
   the reason is: the original LogicalProject has collation trait (see the 
picture in [FLINK-15381](https://issues.apache.org/jira/browse/FLINK-15381): 
[1] which means the second field is ordered and its direction is ascending), 
but when LogicalProject converts to LogicalCalc in ProjectToCalcRule, the 
collation info of new Calc is empty. The root cause is the collation derive 
logic on RelSubset in RelMdCollation in not collect.
   This PR aim to fix the bug*
   
   
   ## Brief change log
   
     - *Implement Collation handler in Flink (most logic except the part about 
RelSubset is same with RelMdCollation)*
   
   
   ## Verifying this change
   
   
   This change added tests and can be verified as follows:
   
     - *Added FlinkRelMdCollationTest to verify the collation derive logic on 
each RelNode *
     - *Added test that validates the plan of `select cast(a as int), cast(b as 
varchar) from (values (3, 'c')) T(a,b)`*
     
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes / **no)**
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** 
/ don't know)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no)**
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs 
/ **not documented**)
   

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


With regards,
Apache Git Services

Reply via email to