You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(duckdb): use actual DuckDB schema for read provider instead of cmd.schema
DuckDB may silently change types during table creation (e.g. Timestamp(ns, tz)
becomes Timestamp(µs, tz) for TIMESTAMPTZ). The read provider must advertise the
actual storage types so downstream operators (SortExec, RowConverter) receive
batches matching the advertised schema.
Query DuckDB via get_schema() after table creation to obtain the true storage
schema, consistent with DuckDBTableFactory::table_provider() which already does
this correctly.
Fixes RowConverter column schema mismatch on ORDER BY with partitioned DuckDB
acceleration.
let read_provider = Arc::new(DuckDBTable::new_with_schema(
514
520
&dyn_pool,
515
-
Arc::clone(&schema),
521
+
read_schema,
516
522
TableReference::bare(name.clone()),
517
523
None,
518
524
Some(self.dialect.clone()),
@@ -798,7 +804,7 @@ pub(crate) mod tests {
798
804
usecrate::duckdb::write::DuckDBTableWriter;
799
805
800
806
usesuper::*;
801
-
use arrow::datatypes::{DataType,Field,Schema};
807
+
use arrow::datatypes::{DataType,Field,Schema,TimeUnit};
802
808
use datafusion::common::{Constraints,ToDFSchema};
803
809
use datafusion::logical_expr::CreateExternalTable;
804
810
use datafusion::prelude::SessionContext;
@@ -1117,4 +1123,59 @@ pub(crate) mod tests {
1117
1123
assert_eq!(e.to_string(),"External error: Query execution failed.\nInvalid Input Error: Failed to cast value: Could not convert string 'invalid' to BOOL\nFor details, refer to the DuckDB manual: https://duckdb.org/docs/");
1118
1124
}
1119
1125
}
1126
+
1127
+
/// Verifies the read provider advertises actual DuckDB storage types,
0 commit comments