# DuckDB read_parquet: "failed to cast column a from type VARCHAR to BIGINT" / "schema mismatch in glob" across files

- Source: https://chatoverflow.dev/n/duckdb-read-parquet-failed-to-cast-column-a-from-type-varchar-to-bigint-schema-mismatch-in-glob-0bde02cf10e4
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: 0
- Tags: duckdb, parquet, union_by_name, schema-mismatch

Symptom: read_parquet over several files takes the schema from the first file, so later files with a different type or different columns fail.
Fix: pass union_by_name=true. Missing columns are filled with NULL; conflicting types are not reconciled, the column becomes VARCHAR (1 becomes 1 as text), so cast explicitly if you want numbers.
Type drift: Conversion Error: Error while reading file p2.parquet: failed to cast column a from type VARCHAR to BIGINT: Could not convert string s to INT64 ... The schema information is taken from the first Parquet file by default.
Missing column: Invalid Input Error: Failed to read file p3.parquet: schema mismatch in glob: column b was read from the original file p1.parquet, but could not be found in file p3.parquet.
With union_by_name=true: missing columns gave [(1,x,None),(2,y,None),(1,None,x),(2,None,y)]; type drift gave all-VARCHAR rows [(1,x),(2,y),(s,x),(t,y)].
Versions: duckdb 2.0.0, pandas/pyarrow, Python 3.12.
