Consistent Parquet field_id between Integrate (CDC) and Refresh, or an option to omit field_id, for Apache Iceberg targets
Which database system?:
Oracle 19c (physical standby) source, HVR hub on Oracle, target is a file location on S3 (FileFormat /Parquet /ParquetVersion=v3). Seen on HVR 5.7.0/46.2, and with HVR 6.3.0/14 (CDC files) and 6.2.0/45 (refresh files).
Additional details:
Problem
For the same table, channel and HVR build, the two write paths number the Parquet field_id differently:
- Integrate (CDC): first column field_id = 6 (143-column table: 6 .. 148)
- Refresh (hvrrefresh -Cinitialload, bulk, sliced): first column field_id = 0 (143-column table: 0 .. 142)
Column names, order, count and data types are identical. Only the field_id values differ, by exactly 6 on every column. We saw this on every table we checked (30, 97 and 143 columns) and on two independent hubs.
Impact
Apache Iceberg identifies columns by field_id, not by name. When a Parquet file carries field IDs, Iceberg readers (Spark, Trino/Athena, Redshift) use them and ignore the table's name mapping. Our Iceberg table follows the CDC numbering, so refresh files are read 6 columns off. Where types differ, the query fails. Where types happen to match, rows load silently with values from the wrong column. The same files read correctly in a plain Parquet table, because those readers match by name.
Test results (small table, real HVR 5.7 output, files registered with Iceberg add_files)
- CDC files as written: all values NULL
- Refresh files as written: query fails (ClassCastException BigIntVector)
- Refresh files with IDs shifted +6: same as CDC (all NULL)
- Files rewritten with field IDs removed (CDC, refresh, and both together): correct results, because Iceberg uses the name mapping
What we are asking for
Any one of these, as a documented and supported HVR option:
1. Integrate and Refresh write the same field IDs for the same table.
2. A parameter on FileFormat /Parquet (or on ColumnProperties) to omit field_id from the Parquet schema.
3. Field IDs that start at 1 (the Iceberg convention) on both paths.
Option 2 is the simplest for us, because it lets Iceberg use its name mapping.
Why it matters
Iceberg is the standard table format for our downstream data lake. Customers who load HVR Parquet into Iceberg today need an extra transformation step (for example Spark) between HVR and Iceberg. A consistent or optional field_id would remove that step and the risk of silent wrong-column loads.
Current workaround
A step after each refresh rewrites the refresh Parquet files with field_id removed before Iceberg sees them. We would prefer a supported HVR option.
Related support case
Please link to our support case about Parquet field_id differing between Integrate (CDC) and Refresh. Support Engineer: Vijayaragavendran Sundararajan. Engineering has confirmed the behavior exists in HVR and recommended raising this Feature Request.
Notes
- We can share footer dumps (schema with field IDs, row counts, created_by) and a synthetic reproduction. We cannot share the data files (financial data).
- Reproduce with pyarrow: print PARQUET:field_id for the first columns of one CDC file and one refresh file of the same table. CDC shows 6, 7, 8. Refresh shows 0, 1, 2.
Please sign in to leave a comment.
Comments
0 comments