wuchong opened a new pull request #7923: [FLINK-11703][table-planner-blink] Introduce TableEnvironments and support registerDataStream and sqlQuery URL: https://github.com/apache/flink/pull/7923 ## What is the purpose of the change In order to support plan tests, we need the ability to register a DataStream (or TableSource) and perform sql query on it. This issue is aiming to introduce a basic and simple TableEnvironment which only support registerDataStream and sqlQuery. In the context of [FLINK-11067](https://issues.apache.org/jira/browse/FLINK-11067) and [FLINK-11068](https://issues.apache.org/jira/browse/FLINK-11068) (convert TableEnvironments and Tables to interfaces), the introduced TableEnvironment in table-planner-blink is a temporary solution and will be refactored/moved to a BlinkPlanner, once FLINK-11067, FLINK-11068 is done. ## Brief change log There are 2 commits: 1. first commit: copy files from `flink-table-planner`. They are no big changes to blink, so I copied them to reduce review effort. Including `FlinkCalciteSqlValidator`, `FlinkPlannerImpl`, `FlinkRelBuilder`, `FlinkRelOptClusterFactory`, `RelTable`, `TimeIndicatorTypeInfo`. 2. second commit: Introduce TableEnvironments. - The `TableEnvironment` is slim which only support `registerDataStream` and `sqlQuery` and remove all the other methods. Will add some other methods if needed (e.g. `registerFunctions`, `registerTableSource`, `writeToSink`, etc...) - Add an empty `Table` class, no transformation methods in it. This is only a placeholder to support end-to-end tests for Blink planner. - Didn't introduce `Expression` classes as it is too big. We use `Symbol` to replace `Expression` for Scala and use `str.split(",").map(_.trim)` to replace `ExpressionParser` for Java. So that only support plain field names currently, alias and time attribute are not supported. ## Verifying this change Add a `TableEnvironmentTest` to verify `registerDataStream` and `sqlQuery`. ## 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? (no) - If yes, how is the feature documented? (not applicable)
---------------------------------------------------------------- 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
