apache / apache/gluten

[VL][FLINK] Avoid mutable calls to `velox4j.plan.PlanNode#setSources()`

Open
#9,566 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Scala
Stars
1.6k
Forks
657
Avg merge
2d 21h
Merged PRs (30d)
85

Description

[This API](https://github.com/bigo-sg/velox4j/blob/1239b1ea42961cacbe38294a01304f2acc0f10f3/src/main/java/io/github/zhztheplayer/velox4j/plan/PlanNode.java#L26-L28) added by `bigo-sg/velox4j` is powerful but breaks the immutability of the plan node. We look to replace the practice with one of the two possible options:

1. Refactor gluten-flink's code to avoid the `setSources` calls;
2. Add immutable `PlanNode#withNewSources` API or a builder-based API or so, which internally do copies on the query plan to change the sources.

Either way would be more elegant than the current solution.

Contributor guide

Open the contributing guide

Research direction

Start with the linked PlanNode.java definition and then locate the gluten-flink code that calls setSources. Compare the two proposed approaches and determine which is accepted before changing anything. Done means mutable setSources calls are removed or replaced with an immutable source-update API, with the relevant tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.