Skip to content

Commit 1dc720b

Browse files
andygroveclaude
andcommitted
Fix dictionary type mismatch in columnar_to_row conversion
When an array is dictionary-encoded, store the actual array type instead of the schema type in TypedArray::Dictionary. This fixes the error "Expected Dictionary type but got Binary" that occurred when processing BloomFilter columns with native_comet scan implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5687f79 commit 1dc720b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

native/core/src/execution/columnar_to_row.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ enum TypedArray<'a> {
7878

7979
impl<'a> TypedArray<'a> {
8080
/// Pre-downcast an ArrayRef to a TypedArray.
81-
fn from_array(array: &'a ArrayRef, schema_type: &DataType) -> CometResult<Self> {
81+
fn from_array(array: &'a ArrayRef, _schema_type: &DataType) -> CometResult<Self> {
8282
let actual_type = array.data_type();
8383
match actual_type {
8484
DataType::Boolean => Ok(TypedArray::Boolean(
@@ -223,7 +223,7 @@ impl<'a> TypedArray<'a> {
223223
})?,
224224
Arc::clone(field),
225225
)),
226-
DataType::Dictionary(_, _) => Ok(TypedArray::Dictionary(array, schema_type.clone())),
226+
DataType::Dictionary(_, _) => Ok(TypedArray::Dictionary(array, actual_type.clone())),
227227
_ => Err(CometError::Internal(format!(
228228
"Unsupported data type for pre-downcast: {:?}",
229229
actual_type

0 commit comments

Comments
 (0)