# DuckDB Parquet read error: column count mismatch between schema and data pages

- **ID:** `data/duckdb-parquet-mismatch-column-count`
- **Domain:** data
- **Category:** data_error
- **Error Code:** `IOException`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Parquet file has a corrupted metadata footer where the schema declares more columns than exist in the actual data pages, often caused by incomplete writes or file truncation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| DuckDB 0.9.0+ | active | — | — |
| Apache Parquet 1.12.0+ | active | — | — |
| PyArrow 12.0.0+ | active | — | — |

## Workarounds

1. **Repair the file by reading with PyArrow and rewriting: `import pyarrow.parquet as pq; table = pq.read_table('corrupted.parquet'); pq.write_table(table, 'fixed.parquet')`** (90% success)
   ```
   Repair the file by reading with PyArrow and rewriting: `import pyarrow.parquet as pq; table = pq.read_table('corrupted.parquet'); pq.write_table(table, 'fixed.parquet')`
   ```
2. **Use DuckDB's `read_parquet` with `union_by_name=true` to attempt schema reconciliation: `SELECT * FROM read_parquet('file.parquet', union_by_name=true)`** (70% success)
   ```
   Use DuckDB's `read_parquet` with `union_by_name=true` to attempt schema reconciliation: `SELECT * FROM read_parquet('file.parquet', union_by_name=true)`
   ```
3. **Manually inspect the Parquet metadata with `parquet-tools meta file.parquet` and truncate the schema in the footer if possible.** (50% success)
   ```
   Manually inspect the Parquet metadata with `parquet-tools meta file.parquet` and truncate the schema in the footer if possible.
   ```

## Dead Ends

- **** — The corruption is in the file itself; re-downloading the same source without verification repeats the issue. (60% fail)
- **** — DuckDB does not have an ignore_errors option for Parquet; it will fail on metadata parsing. (90% fail)
