You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/14 07:51:19 UTC

[GitHub] [flink] wuchong opened a new pull request #8736: Table schema

wuchong opened a new pull request #8736: Table schema
URL: https://github.com/apache/flink/pull/8736
 
 
   
   ## What is the purpose of the change
   
   The primary key and unique key is a standard meta information in SQL. And they are important information for optimization, for example, AggregateRemove, AggregateReduceGrouping and state layout optimization for TopN and Join.
   
   So in this PR, we extend TableSchema to carry more information about primary key and unique keys. So that the TableSource can declare this meta information.
   
   The primary key and unique key information will only work in Blink planner currently. Flink planner will just ignore the information.
   
   ## Brief change log
   
   This pull request contains 2 commits:
   
   1. Add primary key and unique key to `TableSchema` with some Javadocs. 
   2. Use the primary key and unique key information in Blink planner. 
    - We did some refactor to `TableSourceTable` to make it only build the `FlinkStatistic` from `TableSource` instead of passing in from outside. Along with some tests changes. 
   
   
   ## Verifying this change
   
   1. Adds a `TableSchemaTest` to check the schema builder methods.
   2. Adds `FlinkRelMdUniqueKeysTest#testGetUniqueKeysOnTableSourceScan`  test to check the optimizer can get the unique key information from  `TableSchema` from `TableSource`.
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (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:
users@infra.apache.org


With regards,
Apache Git Services