Vortex StructFields permits duplicate field names in memory (documented at vortex-array/src/dtype/struct_.rs:122), but DuckDB struct types require unique names: DuckDB's SQL binder rejects duplicates outright, and its Parquet reader silently renames them (a, a becomes a, a_1). The DType to LogicalType conversion in vortex-duckdb does neither.
TryFrom<&StructFields> for LogicalType (vortex-duckdb/src/convert/dtype.rs:318) passes field names through verbatim, and the underlying duckdb_create_struct_type C API does no validation, so a Vortex struct with two identically-named fields produces a DuckDB struct type carrying duplicate names. Name-based field access on that type is then ambiguous.
Minimal reproduction (mirrors the crate's own test_struct_type):
let field_names = FieldNames::from([FieldName::from("a"), FieldName::from("a")]);
let field_types = vec![
DType::Primitive(PType::I32, Nullability::Nullable),
DType::Primitive(PType::I64, Nullability::Nullable),
];
let dtype = DType::Struct(StructFields::new(field_names, field_types), Nullability::NonNullable);
// Succeeds, yielding STRUCT(a INTEGER, a BIGINT). DuckDB's binder would reject this
// outright, and its Parquet reader would rename it to STRUCT(a INTEGER, a_1 BIGINT).
let logical_type = LogicalType::try_from(&dtype).unwrap();
The same gap exists on the top-level scan-schema path (extract_schema_from_dtype, vortex-duckdb/src/projection.rs:292) for top-level column names, so scanning a Vortex file whose (possibly nested) schema has duplicate field names reaches the same unchecked conversion.
Vortex
StructFieldspermits duplicate field names in memory (documented atvortex-array/src/dtype/struct_.rs:122), but DuckDB struct types require unique names: DuckDB's SQL binder rejects duplicates outright, and its Parquet reader silently renames them (a,abecomesa,a_1). TheDTypetoLogicalTypeconversion invortex-duckdbdoes neither.TryFrom<&StructFields> for LogicalType(vortex-duckdb/src/convert/dtype.rs:318) passes field names through verbatim, and the underlyingduckdb_create_struct_typeC API does no validation, so a Vortex struct with two identically-named fields produces a DuckDB struct type carrying duplicate names. Name-based field access on that type is then ambiguous.Minimal reproduction (mirrors the crate's own
test_struct_type):The same gap exists on the top-level scan-schema path (
extract_schema_from_dtype,vortex-duckdb/src/projection.rs:292) for top-level column names, so scanning a Vortex file whose (possibly nested) schema has duplicate field names reaches the same unchecked conversion.