Skip to content

Loop-variable references in properties the compiled plan is built from give wrong output #8749

Closed

Description

@aglinxinyuan

What happened?

Inside a loop block, a loop-variable reference (#8635, #8639) in a property that the compiler builds an operator's output schema or partitioning from gives wrong output or a misleading error.

Root cause: the compiler builds the schema and the partitioning when the workflow compiles, from the reference's placeholder. The loop state writes the variable's value into the operator's setting only later, when the loop runs, so the value never reaches them.

Before:  Loop Start (a = "x") -> Projection (alias $a) -> Loop End
         output column named "$a", null in every row
After:   compile error naming the property: its value decides the plan before the loop runs
Operator and property What happens today
Projection alias a column literally named $a, null in every row
Projection drop option the keep-mode schema, while the operator drops
Dictionary Matcher, Unnest String, Aggregate result attribute; File Scan From Input attribute the output column stays literally $r
Sort Partitions domain min / max the range partition stays 0 to 0
Hash Join and Interval Join keys, Type Casting attribute, Aggregate group-by keys, Sort Partitions attribute a misleading error later in the run

The same holds for a running workflow's operator that is modified while it runs: its rebuilt executor never has the loop variables written into it.

How to reproduce?

On the #8639 branch: build Text Input -> Loop Start (a = "x") -> Projection (alias of a column set to $a) -> Loop End and run it. Loop End's result has a column named $a whose values are all null.

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

64c8160 (the #8639 branch)

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Activity

  1. self-assigned this
    on Sep 29, 2026
  2. added theissue type on Sep 29, 2026
  3. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue, @aglinxinyuan!

    It looks like the issue description doesn't quite follow our template yet:

    • This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.

    Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

    You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

  4. added a commit that references this issue on Oct 10, 2026
    3fa608d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions