Skip to content

Commit 5ac2230

Browse files
[hotfix] Add a docs page with module specific guides for flink contributors
Signed-off-by: slinkydeveloper <[email protected]>
1 parent c81a530 commit 5ac2230

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
```

flink-table/flink-table-planner/src/test/resources/log4j2-test.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
rootLogger.level = OFF
2222
rootLogger.appenderRef.test.ref = TestLogger
2323

24+
appenders = testlogger
2425
appender.testlogger.name = TestLogger
2526
appender.testlogger.type = CONSOLE
2627
appender.testlogger.target = SYSTEM_ERR
2728
appender.testlogger.layout.type = PatternLayout
2829
appender.testlogger.layout.pattern = %-4r [%t] %-5p %c %x - %m%n
30+
31+
# Uncomment the following lines to debug the planning
32+
loggers = testlogger
33+
logger.testlogger.name = org.apache.calcite.plan
34+
logger.testlogger.level = DEBUG
35+
logger.testlogger.appenderRefs = TestLogger

0 commit comments

Comments
 (0)