|
| 1 | +--- |
| 2 | +title: "Module specific guides" |
| 3 | +weight: 22 |
| 4 | +type: docs |
| 5 | +aliases: |
| 6 | +- /flinkDev/module_specific_guides.html |
| 7 | +- /internals/module_specific_guides.html |
| 8 | +--- |
| 9 | +<!-- |
| 10 | +Licensed to the Apache Software Foundation (ASF) under one |
| 11 | +or more contributor license agreements. See the NOTICE file |
| 12 | +distributed with this work for additional information |
| 13 | +regarding copyright ownership. The ASF licenses this file |
| 14 | +to you under the Apache License, Version 2.0 (the |
| 15 | +"License"); you may not use this file except in compliance |
| 16 | +with the License. You may obtain a copy of the License at |
| 17 | +
|
| 18 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 19 | +
|
| 20 | +Unless required by applicable law or agreed to in writing, |
| 21 | +software distributed under the License is distributed on an |
| 22 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 23 | +KIND, either express or implied. See the License for the |
| 24 | +specific language governing permissions and limitations |
| 25 | +under the License. |
| 26 | +--> |
| 27 | + |
| 28 | +# Module specific guides |
| 29 | + |
| 30 | +This page includes a list of guides, tips and tricks for contributing to specific Flink modules. |
| 31 | + |
| 32 | +## Flink Table/SQL |
| 33 | + |
| 34 | +### Debug the planner |
| 35 | + |
| 36 | +When working on planner rules, It's useful to investigate which rules are applied, in which order and what transformation every rule generates. |
| 37 | +In order to find out these details when running a planner test, you can enable the Calcite planner logging in debug mode adding the following lines to the log configuration in `flink-table/flink-table-planner/src/test/resources/log4j2-test.properties`: |
| 38 | + |
| 39 | +``` |
| 40 | +loggers = testlogger |
| 41 | +logger.testlogger.name = org.apache.calcite.plan |
| 42 | +logger.testlogger.level = DEBUG |
| 43 | +logger.testlogger.appenderRefs = TestLogger |
| 44 | +``` |
| 45 | + |
| 46 | +This is a sample output: |
| 47 | + |
| 48 | +``` |
| 49 | +[...] |
| 50 | +3855 [main] DEBUG org.apache.calcite.plan.RelOptPlanner [] - call#1: Apply rule [FlinkJoinPushExpressionsRule] to [rel#40:LogicalJoin.NONE.any.None: 0.[NONE].[NONE](left=HepRelVertex#34,right=HepRelVertex#39,condition=AND(=($0, $5), >=($3, -($8, 3600000:INTERVAL HOUR)), <=($3, +($8, 3600000:INTERVAL HOUR))),joinType=inner)] |
| 51 | +3855 [main] DEBUG org.apache.calcite.plan.AbstractRelOptPlanner.rule_execution_summary [] - Rule Attempts Info for HepPlanner |
| 52 | +3856 [main] DEBUG org.apache.calcite.plan.AbstractRelOptPlanner.rule_execution_summary [] - |
| 53 | +Rules Attempts Time (us) |
| 54 | +FlinkJoinPushExpressionsRule 1 143 |
| 55 | +* Total 1 143 |
| 56 | +[...] |
| 57 | +``` |
0 commit comments