Skip to content

fix: ParquetImporter detects duplicate column names before VortexWriter#288

Merged
dfa1 merged 1 commit into
mainfrom
fix/parquet-importer-duplicate-column-names
Jul 19, 2026
Merged

fix: ParquetImporter detects duplicate column names before VortexWriter#288
dfa1 merged 1 commit into
mainfrom
fix/parquet-importer-duplicate-column-names

Conversation

@dfa1

@dfa1 dfa1 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • ParquetImporter now checks the source Parquet schema for duplicate column names right after building it, and throws a clear, actionable IllegalArgumentException naming the duplicate(s) and the source file — instead of surfacing VortexWriter's internal uniqueness-invariant error several stack frames removed from the real cause.
  • Root cause is always the source Parquet file's own schema; DType.Struct legitimately permits duplicate names in memory and VortexWriter correctly enforces the file format's uniqueness requirement. This only improves error quality at the import boundary — no auto-disambiguation (would mask a real data-quality problem).
  • Fixes ParquetImporter: confusing error on Parquet files with duplicate column names #280.

Test plan

  • New ParquetImporterTest$DuplicateNames unit tests (no-dup passthrough + duplicate-throws with name/path in message)
  • Full ParquetImporterTest: 26/26 pass
  • Verified against the real repro (Raincloud's uk-price-paid slug, hydrated locally): now throws IllegalArgumentException: Parquet schema has duplicate column name(s): [A]; source file: .../uk-price-paid.parquet

🤖 Generated with Claude Code

Previously the first signal a caller got was VortexWriter's internal
uniqueness check, several stack frames removed from the real cause and
with no mention of which import or source file triggered it:

  java.lang.IllegalArgumentException: duplicate field name: A
      at io.github.dfa1.vortex.writer.VortexWriter.<init>(VortexWriter.java:164)
      at io.github.dfa1.vortex.parquet.ParquetImporter.importParquet(...)

checkNoDuplicateNames now runs right after the schema is built from the
Parquet columns, throwing a ParquetImporter-specific message naming the
duplicate(s) and the source file. Root cause is always the source
Parquet file's own schema (DType.Struct legitimately permits duplicate
names in memory; VortexWriter correctly enforces the file format's
uniqueness requirement) — this only improves error quality at the
import boundary, no auto-disambiguation.

Verified against the real repro (Raincloud's uk-price-paid slug, whose
source CSV lacked a header row so the Parquet conversion tool used the
first data row's values as column names):

  IllegalArgumentException: Parquet schema has duplicate column
  name(s): [A]; source file: .../uk-price-paid.parquet

Fixes #280.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit c148393 into main Jul 19, 2026
6 checks passed
@dfa1
dfa1 deleted the fix/parquet-importer-duplicate-column-names branch July 19, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParquetImporter: confusing error on Parquet files with duplicate column names

1 participant