Skip to content

fix(workflow-operator, v1.2): Text Input operator using offset with an empty limit emits no rows - #7529

Merged
aglinxinyuan merged 3 commits into
apache:release/v1.2from
eugenegujing:backport/text-input-offset-overflow-v1.2
Aug 13, 2026
Merged

fix(workflow-operator, v1.2): Text Input operator using offset with an empty limit emits no rows#7529
aglinxinyuan merged 3 commits into
apache:release/v1.2from
eugenegujing:backport/text-input-offset-overflow-v1.2

Conversation

@eugenegujing

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Backport of #7347 to release/v1.2, cherry-picked from main commit 91235fb (clean, no conflicts).

TextInputSourceOpExec computed its line window as slice(offset, offset + limit.getOrElse(Int.MaxValue)). With an Offset set and the Limit left empty, the addition overflows Int to a negative bound, which Scala 2.13's Iterator.slice clamps to 0 and then returns an empty iterator — so the operator silently emitted zero rows while the workflow reported success. Any Offset ≥ 1 with an empty Limit is affected, and an explicit large Limit (e.g. Int.MaxValue) overflows the same way. This contradicts the Limit property's own description, "Leave empty to read all lines."

The fix replaces the slice with drop(offset) + take(limit), the same idiom the CSV, Arrow, and JSONL scan sources already use. There is no addition, so nothing can overflow; every configuration that previously worked is unchanged.

Any related issues, documentation, discussions?

Backport of #7347 (originally closed #7346).

How was this PR tested?

The 7 regression tests from #7347 come along with the cherry-pick. On this branch:

sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.scan.text.TextInputSourceOpDescSpec"
# 15 tests, all passed (8 pre-existing on release/v1.2 + 7 new)
# (main has 17: two getPhysicalOp/propagateSchema coverage tests were added
#  to this spec after v1.2 branched and are unrelated to this fix)

sbt "WorkflowOperator/scalafmtCheck" "WorkflowOperator/Test/scalafmtCheck"
# passed

sbt "WorkflowOperator/scalafixAll --check"
# passed

Was this PR authored or co-authored using generative AI tooling?

Co-authored by: Claude Code (Claude Fable 5)

…n empty limit emits no rows

(cherry picked from commit 91235fb)
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

@aglinxinyuan
aglinxinyuan enabled auto-merge August 12, 2026 05:04
@aglinxinyuan
aglinxinyuan disabled auto-merge August 13, 2026 05:07
@aglinxinyuan
aglinxinyuan enabled auto-merge August 13, 2026 05:07
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.88%. Comparing base (80de40f) to head (265b25f).
⚠️ Report is 2 commits behind head on release/v1.2.

Additional details and impacted files
@@               Coverage Diff               @@
##             release/v1.2    #7529   +/-   ##
===============================================
  Coverage           52.88%   52.88%           
+ Complexity           2527     2526    -1     
===============================================
  Files                1078     1078           
  Lines               42367    42367           
  Branches             4565     4565           
===============================================
  Hits                22405    22405           
  Misses              18645    18645           
  Partials             1317     1317           
Flag Coverage Δ *Carryforward flag
access-control-service 64.35% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from 9ead9e9
amber 53.00% <100.00%> (ø)
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.06% <ø> (ø)
file-service 61.72% <ø> (ø)
frontend 47.29% <ø> (ø) Carriedforward from 9ead9e9
pyamber 93.07% <ø> (ø) Carriedforward from 9ead9e9
python 90.88% <ø> (ø) Carriedforward from 9ead9e9
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 13, 2026
Merged via the queue into apache:release/v1.2 with commit 2a8b858 Aug 13, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants