TsReaper opened a new pull request #12202: URL: https://github.com/apache/flink/pull/12202
## Pre-review Note This PR is waiting for #12122 to merge. The 1st commit is exactly the same with the blocking PR. Please start reviewing from the 2nd commit. This PR will be rebased once the block PR is merged. ## What is the purpose of the change This PR is part of the [FLINK-14807](https://issues.apache.org/jira/browse/FLINK-14807) which is going to introduce a collecting method for tables. See [here](https://docs.google.com/document/d/13Ata18-e89_hAdfukzEJYreOg2FBZO_Y0RohLDAme6Y/edit) for the whole design document. Currently Flink uses accumulators to fetch batch query results and sockets for streaming query results. These methods has the following disadvantages: * accumulators might become very large and eat up JM's memory; * sink might not be able to communicate directly with client through socket, for example under a Yarn / k8s execution environment. This PR combines the previous 3 PRs which uses coordinators in JM as proxy between clients and sinks, so that collecting query results are supported under all execution and network environments with any amount of results. ## Brief change log - Change current result collecting method to support collecting query results under all execution and network environments ## Verifying this change This change is already covered by existing tests (all tests calling `TableResults#collect` will cover this PR). ## 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/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: us...@infra.apache.org