fix(workflow-operator): auto-rename empty CSV column headers#5282
Merged
Conversation
A CSV with an empty column header (e.g. a trailing comma `id,name,,age`) produced an `Attribute` with an empty name. After apache#3295 every output port writes via `IcebergTableWriter -> Parquet`, where Avro rejects empty names with `IllegalArgumentException: Empty name` at flush time, losing the operator port's entire result. Rename blank header positions to `column-<index>` (matching the convention used by pandas, Spark, R, and DuckDB) in all three CSV scan operators: `CSVScanSourceOpDesc`, `ParallelCSVScanSourceOpDesc`, and `CSVOldScanSourceOpDesc`. `ParallelCSVScanSourceOpDesc` is currently commented out of `LogicalOp`'s registry (unreachable from the UI) but is fixed for consistency and in case it is re-enabled for experiments. Closes apache#5279.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5282 +/- ##
============================================
+ Coverage 49.09% 49.12% +0.03%
- Complexity 2372 2377 +5
============================================
Files 1051 1051
Lines 40344 40334 -10
Branches 4277 4277
============================================
+ Hits 19805 19813 +8
+ Misses 19379 19358 -21
- Partials 1160 1163 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aglinxinyuan
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
A CSV with an empty column header (e.g. a trailing comma
id,name,,age) produced anAttributewith an empty name. After #3295 every output port writes viaIcebergTableWriter → Parquet, where Avro rejects empty names withIllegalArgumentException: Empty nameat flush time — losing the operator port's entire result.Rename blank header positions to
column-<index>(the convention used by pandas, Spark, R, and DuckDB) in all three CSV scan operators:CSVScanSourceOpDesc,ParallelCSVScanSourceOpDesc, andCSVOldScanSourceOpDesc. The issue named the first two; the legacycsvOldvariant is still registered inLogicalOpand had the same latent bug.Note:
ParallelCSVScanSourceOpDescis currently commented out ofLogicalOp's operator registry (so it is not reachable from the UI), but it is fixed here for consistency and so the bug does not resurface if it is re-enabled for experiments.Any related issues, documentation, discussions?
Closes #5279.
How was this PR tested?
Added three cases to
CSVScanSourceOpDescSpec— one per operator — feeding a CSV with an empty third header (id,name,,age) and asserting the inferred schema is["id", "name", "column-3", "age"].WorkflowOperatorsuite is green (13 passed); scalafmt clean.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-7)