[FLINK-29088][table] Extract the common project to enhance source reuse
What is the purpose of the change
This PR is meant to provide a way to extract the common project for the same source in a single rel tree. So that in the SubPlanReuser it can reuse the source as much as possible.
Brief change log
- Add a new rule
FlinkPushCommonProjectOnSourceRuleto create the common project - Exclude some rules to avoid optimize the generated common project
- Also copied two rule from calcite to avoid optimize the generated project. I think this can be removed after https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-5264
Verifying this change
This change added tests and can be verified as follows:
- SubplanReuseTest#testEnableReuseTableSourceOnNewSourceProjectPushDown
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, Kubernetes/Yarn, 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? (docs)
@twalthr @godfreyhe please help take a look when you are free
CI report:
- 86eb1276459f23a2d37f1e77f5fa312c63d14f20 Azure: FAILURE
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
The CI failed by https://issues.apache.org/jira/browse/FLINK-29093
@flinkbot run azure
@flinkbot run azure
@flinkbot run azure
The failures seems related to the CI environment

@Aitozi Can you rebase this PR?