featzhang opened a new pull request, #27610:
URL: https://github.com/apache/flink/pull/27610
## What is the purpose of the change
This PR enhances the explain output of FlinkLogicalJoin to display join
conditions in a more readable and structured format. Instead of showing
low-level positional references like `=($0, $3)`, it now displays actual field
names in a clear format.
**Before:**
```
Join(condition=[=($0, $3)])
```
**After:**
```
Join:
Type: INNER
Condition: user_id = id
```
## Brief change log
- Add `explainTerms` override method in FlinkLogicalJoin class
- Implement `formatJoinCondition` method for recursive RexNode condition
parsing
- Implement `formatOperand` method for field reference resolution
- Support for EQUALS, AND, OR operators with proper field name resolution
- Use FlinkRexUtil.getExpressionString as fallback for complex expressions
## Verifying this change
This change is a display-only enhancement and can be verified by:
1. Build the flink-table-planner module:
```bash
./mvnw clean install -DskipTests -Pfast -pl
flink-table/flink-table-planner
```
2. Run EXPLAIN queries in Flink SQL Client with joins:
```sql
EXPLAIN SELECT * FROM orders o JOIN users u ON o.user_id = u.id;
```
3. Verify the join condition is displayed with field names instead of
positional references
## 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, ZooKeeper: **No**
- The S3 file system connector: **No**
## Documentation
- Does this pull request introduce a new feature? **No** (Enhancement only)
- If yes, how is the feature documented? **Not applicable**
This change only enhances the explain output format and does not modify any
RelNode structure, query optimization logic, or runtime behavior. It has zero
impact on performance and is 100% backward compatible.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]