sjwiesman commented on a change in pull request #9362: [FLINK-13354] [docs] Add documentation for how to use blink planner URL: https://github.com/apache/flink/pull/9362#discussion_r311146724
########## File path: docs/dev/table/common.md ########## @@ -1304,20 +1414,50 @@ val table: Table = tableEnv.fromDataStream(stream, 'name as 'myName) Query Optimization ------------------ -Apache Flink leverages Apache Calcite to optimize and translate queries. The optimization currently performed include projection and filter push-down, subquery decorrelation, and other kinds of query rewriting. Flink does not yet optimize the order of joins, but executes them in the same order as defined in the query (order of Tables in the `FROM` clause and/or order of join predicates in the `WHERE` clause). +<div class="codetabs" markdown="1"> +<div data-lang="Flink planner" markdown="1"> + +Apache Flink leverages Apache Calcite to optimize and translate queries. The optimization currently performed include projection and filter push-down, subquery decorrelation, and other kinds of query rewriting. Flink planner does not yet optimize the order of joins, but executes them in the same order as defined in the query (order of Tables in the `FROM` clause and/or order of join predicates in the `WHERE` clause). + +It is possible to tweak the set of optimization rules which are applied in different phases by providing a `CalciteConfig` object. This can be created via a builder by calling `CalciteConfig.createBuilder())` and is provided to the TableEnvironment by calling `tableEnv.getConfig.setPlannerConfig(calciteConfig)`. + +</div> + +<div data-lang="Blink planner" markdown="1"> + +The foundation of Apache Flink query optimization is Apache Calcite. In addition to apply Calcite in optimization, Blink planner also does a lot to enhance it. Review comment: @dawidwys @godfreyhe ``` Apache Flink leverages and extends Apache Calcite to perform sophisticated query optimization. This includes a series of rule and cost-based optimizations, including but not limited to: * Subquery decorrelation based on Apache Calcite * Project pruning * Partition pruning * Filter push-down * Sub-plan deduplication to avoid duplicate computation * Special subquery rewriting: * Converts IN and EXISTS into left semi-joins * Converts NOT IN and NOT EXISTS into left anti-join * Optional join reordering * Enabled via `table.optimizer.join-reorder-enabled` {% info %} IN/EXISTS/NOT IN/NOT EXISTS are currently only supported in conjunctive conditions. The optimizer makes intelligent decisions, based not only on the plan but also rich statistics available from the data sources and fine-grain costs for each operator such as io, cpu, network, and memory. Advanced users may provide custom optimizations via a `CalciteConfig` that can be provided to the table environment by calling `TableEnvironment#getConfig#setPlannerConfig`. ``` ---------------------------------------------------------------- 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 With regards, Apache Git Services