Skip to content

Commit 589ca61

Browse files
committed
fix convert arrow list type to duckdb logical type
Signed-off-by: Runji Wang <[email protected]>
1 parent 76014c1 commit 589ca61

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/duckdb/src/vscalar/arrow.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use arrow::{
77

88
use crate::{
99
core::{DataChunkHandle, LogicalTypeId},
10-
vtab::arrow::{data_chunk_to_arrow, write_arrow_array_to_vector, WritableVector},
10+
vtab::arrow::{data_chunk_to_arrow, to_duckdb_logical_type, write_arrow_array_to_vector, WritableVector},
1111
};
1212

1313
use super::{ScalarFunctionSignature, ScalarParams, VScalar};
@@ -35,14 +35,12 @@ impl From<ArrowScalarParams> for ScalarParams {
3535
ArrowScalarParams::Exact(params) => Self::Exact(
3636
params
3737
.into_iter()
38-
.map(|v| LogicalTypeId::try_from(&v).expect("type should be converted").into())
38+
.map(|v| to_duckdb_logical_type(&v).expect("type should be converted"))
3939
.collect(),
4040
),
41-
ArrowScalarParams::Variadic(param) => Self::Variadic(
42-
LogicalTypeId::try_from(&param)
43-
.expect("type should be converted")
44-
.into(),
45-
),
41+
ArrowScalarParams::Variadic(param) => {
42+
Self::Variadic(to_duckdb_logical_type(&param).expect("type should be converted"))
43+
}
4644
}
4745
}
4846
}
@@ -107,7 +105,7 @@ where
107105
.into_iter()
108106
.map(|sig| ScalarFunctionSignature {
109107
parameters: sig.parameters.map(Into::into),
110-
return_type: LogicalTypeId::try_from(&sig.return_type)
108+
return_type: to_duckdb_logical_type(&sig.return_type)
111109
.expect("type should be converted")
112110
.into(),
113111
})

0 commit comments

Comments
 (0)