Feature: Relaxed Parquet / Table Schema Requirements
Author: haydenflinnerCreated Jan 31, 2023Updated Sep 20, 2026
LabelsC-feature
Summary
I have been inserting parquet files to tables predefined by a SQL schema today; found some interesting behaviors. A parquet file with int64 columns will not be coerced down to an int16/32, even if all values would fit. This is fair enough I guess; better to see the problem early than in production very late.
One that could probably be improved is the following error:
2023-01-31T21:38:48.066334Z ERROR databend_query::servers::http::middleware: src/query/service/src/servers/http/middleware.rs:195: http request error: execute fail: parquet schema mismatch, differ: Differences (-expected_field|+infer_field):
-TableField {
+Field {
name: "extra_str",
- default_expr: None,
- data_type: Nullable(
- String,
- ),
+ data_type: Null,
+ is_nullable: true,
+ metadata: {},
}in which I tried to insert a parquet file with a Null column to a table with that column nullable. This seems to me to be harmless, Null => Nullable(X) is lossless.
Are there any other coercions/implicit casts that are under consideration for changing soon?
Source: databendlabs/databend