[ https://issues.apache.org/jira/browse/FLINK-11822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
godfrey he updated FLINK-11822: ------------------------------- Description: Calcite has defined various metadata handlers(e.g. {{RowCoun}}, {{Selectivity}} and provided default implementation(e.g. {{RelMdRowCount}}, {{RelMdSelectivity}}). However, the default implementation can't completely meet our requirements, e.g. some of its logic is incomplete,and some RelNodes are not considered. There are two options to meet our requirements: option 1. Extends from default implementation, overrides method to improve its logic, add new methods for new {{RelNode}}. The advantage of this option is we just need to focus on the additions and modifications. However, its shortcomings are also obvious: we have no control over the code of non-override methods in default implementation classes especially when upgrading the Calcite version. option 2. Extends from metadata handler interfaces, reimplement all the logic. Its shortcomings are very obvious, however we can control all the code logic that's what we want. so we choose option 2! In this jira, all Flink metadata handles will be introduced, including calcite builtin metadata handlers: {{FlinkRelMdPercentageOriginalRow}}, {{FlinkRelMdNonCumulativeCost}}, {{FlinkRelMdCumulativeCost}}, {{FlinkRelMdRowCount}}, {{FlinkRelMdSize}}, {{FlinkRelMdSelectivity}}, {{FlinkRelMdDistinctRowCoun}}, {{FlinkRelMdPopulationSize}}, {{FlinkRelMdColumnUniqueness}}, {{FlinkRelMdUniqueKeys}}, {{FlinkRelMdDistribution}}, and flink extented metadata handlers: {{FlinkRelMdColumnInterval}}, {{FlinkRelMdFilteredColumnInterval}}, {{FlinkRelMdColumnNullCount}}, {{FlinkRelMdColumnOriginNullCount}}, {{FlinkRelMdUniqueGroups}}, {{FlinkRelMdModifiedMonotonicity}} was: Calcite has defined various metadata handlers(e.g. {{RowCoun}}, {{Selectivity}} and provided default implementation(e.g. {{RelMdRowCount}}, {{RelMdSelectivity}}). However, the default implementation can't completely meet our requirements, e.g. some of its logic is incomplete,and some RelNodes are not considered. There are two options to meet our requirements: option 1. Extends from default implementation, overrides method to improve its logic, add new methods for new {{RelNode}}. The advantage of this option is we just need to focus on the additions and modifications. However, its shortcomings are also obvious: we have no control over the code of non-override methods in default implementation classes especially when upgrading the Calcite version. option 2. Extends from metadata handler interfaces, reimplement all the logic. Its shortcomings are very obvious, however we can control all the code logic that's what we want. so we choose option 2! In this jira, only basic metadata handles will be introduced, including: {{FlinkRelMdPercentageOriginalRow}}, {{FlinkRelMdNonCumulativeCost}}, {{FlinkRelMdCumulativeCost}}, {{FlinkRelMdRowCount}}, {{FlinkRelMdSize}}, {{FlinkRelMdSelectivity}}, {{FlinkRelMdDistinctRowCoun}}, {{FlinkRelMdPopulationSize}}, {{FlinkRelMdColumnUniqueness}}, {{FlinkRelMdUniqueKeys}} > Introduce Flink metadata handlers > --------------------------------- > > Key: FLINK-11822 > URL: https://issues.apache.org/jira/browse/FLINK-11822 > Project: Flink > Issue Type: New Feature > Components: Table SQL / Planner > Reporter: godfrey he > Assignee: godfrey he > Priority: Major > Labels: pull-request-available > Fix For: 1.9.0 > > Time Spent: 20m > Remaining Estimate: 0h > > Calcite has defined various metadata handlers(e.g. {{RowCoun}}, > {{Selectivity}} and provided default implementation(e.g. {{RelMdRowCount}}, > {{RelMdSelectivity}}). However, the default implementation can't completely > meet our requirements, e.g. some of its logic is incomplete,and some RelNodes > are not considered. > There are two options to meet our requirements: > option 1. Extends from default implementation, overrides method to improve > its logic, add new methods for new {{RelNode}}. The advantage of this option > is we just need to focus on the additions and modifications. However, its > shortcomings are also obvious: we have no control over the code of > non-override methods in default implementation classes especially when > upgrading the Calcite version. > option 2. Extends from metadata handler interfaces, reimplement all the > logic. Its shortcomings are very obvious, however we can control all the code > logic that's what we want. > so we choose option 2! > In this jira, all Flink metadata handles will be introduced, > including calcite builtin metadata handlers: > {{FlinkRelMdPercentageOriginalRow}}, > {{FlinkRelMdNonCumulativeCost}}, > {{FlinkRelMdCumulativeCost}}, > {{FlinkRelMdRowCount}}, > {{FlinkRelMdSize}}, > {{FlinkRelMdSelectivity}}, > {{FlinkRelMdDistinctRowCoun}}, > {{FlinkRelMdPopulationSize}}, > {{FlinkRelMdColumnUniqueness}}, > {{FlinkRelMdUniqueKeys}}, > {{FlinkRelMdDistribution}}, > and flink extented metadata handlers: > {{FlinkRelMdColumnInterval}}, > {{FlinkRelMdFilteredColumnInterval}}, > {{FlinkRelMdColumnNullCount}}, > {{FlinkRelMdColumnOriginNullCount}}, > {{FlinkRelMdUniqueGroups}}, > {{FlinkRelMdModifiedMonotonicity}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)