godfreyhe opened a new pull request #10429: [FLINK-14965] [table-planner-blink] 
correct the logic of convertToTableStats method in 
CatalogTableStatisticsConverter
URL: https://github.com/apache/flink/pull/10429
 
 
   
   
   ## What is the purpose of the change
   
   *[FLINK-14662](https://issues.apache.org/jira/browse/FLINK-14662) had let 
CatalogTableStatistics.UNKNOWN be consistent with TableStats.UNKNOWN.
   however, the logic in CatalogTableStatisticsConverter#convertToTableStats 
method is also not correct:
   1. HiveCatalog will create a new instance even if all attributes in 
CatalogTableStatistics is unknown instead of using 
CatalogTableStatistics.UNKNOWN. And CatalogTableStatistics does not override 
equals method. So tableStatistics.equals(CatalogTableStatistics.UNKNOWN) is 
always false.
   2. similar logic about equals on CatalogColumnStatistics
   3. even if tableStatistics is null or tableStatistics is 
CatalogTableStatistics.UNKNOWN, the columnStatistics may be not UNKNOWN. It 
also needs to be convert to column stats.
   
   the pr mainly fixes the above incorrect logic.*
   
   
   ## Brief change log
   
     - *correct the logic of convertToTableStats method in 
CatalogTableStatisticsConverter*
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - *Added tests for unknown row count with known column stats*
   
   ## 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:
[email protected]


With regards,
Apache Git Services

Reply via email to