You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "CodeTrainerMan (via GitHub)" <gi...@apache.org> on 2026/09/27 19:03:10 UTC
[PR] [FLINK-40678][table] Include the scan's hints in the lookup join digest [flink]
CodeTrainerMan opened a new pull request, #29306:
URL: https://github.com/apache/flink/pull/29306
## What is the purpose of the change
Two lookup joins on the same table that carry different `OPTIONS` hints are currently deduplicated
into a single node, so that the second join silently reads with the connector options of the first
one:
```sql
SELECT s.a, d.name
FROM MyTable AS s
JOIN LookupTable /*+ OPTIONS('data-id'='probeA') */ FOR SYSTEM_TIME AS OF s.proctime AS d
ON s.a = d.id
UNION ALL
SELECT s.a, d.name
FROM MyTable AS s
JOIN LookupTable /*+ OPTIONS('data-id'='probeB') */ FOR SYSTEM_TIME AS OF s.proctime AS d
ON s.a = d.id
```
plans to a single lookup join with the second branch replaced by `Reused(reference_id=[1])`.
`CommonPhysicalTableSourceScan.explainTerms` adds a `hints` item, so two scans with different
`OPTIONS` stay separate. A lookup join never received the hints of the temporal table's scan:
`CommonLookupJoinRule` passed `tableScan.getTable` but not `tableScan.getHints`, so the hints could
not reach `CommonPhysicalLookupJoin.explainTerms` and both nodes ended up with the same digest.
This commit threads the scan's hints through the rule into the physical node and adds them to the
digest, reusing the `hintsDigest` pattern of `CommonPhysicalTableSourceScan`.
## Brief change log
- `CommonLookupJoinRule`: pass the table scan's hints into `transform`/`transformToLookupJoin`
(previously only the `RelOptTable` was passed on to the physical node)
- `CommonPhysicalLookupJoin`: new `hints` field, exposed in `explainTerms` through `hintsDigest`
- `StreamPhysicalLookupJoin` / `BatchPhysicalLookupJoin`: carry the hints through the constructors
and the `copy` methods
## Verifying this change
Added `LookupJoinTest#testLookupJoinWithDifferentOptionsHintsIsNotDeduplicated`, which plans a
`UNION ALL` of two lookup joins with different `OPTIONS` hints and asserts that both hints survive
in the plan and that the plan contains no `Reused` node. The test fails without the fix.
## 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
- 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40678][table] Include the scan's hints in the lookup join digest [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #29306:
URL: https://github.com/apache/flink/pull/29306#issuecomment-5858882632
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4a8a60612bc1702d245d479fbc2edce73daa0d27",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4a8a60612bc1702d245d479fbc2edce73daa0d27",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4a8a60612bc1702d245d479fbc2edce73daa0d27 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org