@@ -8,9 +8,9 @@ use vortex::array::ExecutionCtx;
88use vortex:: array:: arrays:: DecimalArray ;
99use vortex:: array:: arrays:: decimal:: DecimalDataParts ;
1010use vortex:: array:: match_each_decimal_value_type;
11+ use vortex:: array:: validity:: Validity ;
1112use vortex:: buffer:: Buffer ;
1213use vortex:: dtype:: BigCast ;
13- use vortex:: dtype:: DType ;
1414use vortex:: dtype:: DecimalDType ;
1515use vortex:: dtype:: DecimalType ;
1616use vortex:: dtype:: NativeDecimalType ;
@@ -19,7 +19,6 @@ use vortex::error::VortexResult;
1919use vortex:: error:: vortex_bail;
2020use vortex:: mask:: Mask ;
2121
22- use crate :: duckdb:: LogicalType ;
2322use crate :: duckdb:: VectorBuffer ;
2423use crate :: duckdb:: VectorRef ;
2524use crate :: exporter:: ColumnExporter ;
@@ -49,13 +48,11 @@ pub(crate) fn new_exporter(
4948 values,
5049 } = array. into_data_parts ( ) ;
5150 let dest_values_type = precision_to_duckdb_storage_size ( & decimal_dtype) ?;
52- let nullability = validity. nullability ( ) ;
53- let validity = validity. to_array ( len) . execute :: < Mask > ( ctx) ?;
5451
55- if validity. all_false ( ) {
56- let ltype = LogicalType :: try_from ( DType :: Decimal ( decimal_dtype, nullability) ) ?;
57- return Ok ( all_invalid:: new_exporter ( len, & ltype) ) ;
52+ if matches ! ( validity, Validity :: AllInvalid ) {
53+ return Ok ( all_invalid:: new_exporter ( ) ) ;
5854 }
55+ let validity = validity. to_array ( len) . execute :: < Mask > ( ctx) ?;
5956
6057 let exporter = if values_type == dest_values_type {
6158 match_each_decimal_value_type ! ( values_type, |D | {
0 commit comments