This repository was archived by the owner on Jan 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
optd-datafusion-repr/src/plan_nodes/predicates Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,16 @@ impl Value {
211211 }
212212 _ => panic ! ( "{self} could not be converted into an Date32" ) ,
213213 } ) ,
214- _ => unimplemented ! ( "Have not implemented convert_to_type for DataType {typ}" ) ,
214+ DataType :: Decimal128 ( _, _) => Value :: Decimal128 ( match self {
215+ // TODO: Should we be ignoring the scale and precision here?
216+ Value :: Int128 ( i128) => * i128,
217+ Value :: Int64 ( i64) => ( * i64) . into ( ) ,
218+ Value :: Int32 ( i32) => ( * i32) . into ( ) ,
219+ _ => panic ! ( "{self} could not be converted into an Decimal128" ) ,
220+ } ) ,
221+ _ => unimplemented ! (
222+ "Have not implemented convert_to_type from {self} for DataType {typ}"
223+ ) ,
215224 }
216225 }
217226}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ impl ConstantType {
4646 Value :: Int64 ( _) => ConstantType :: Int64 ,
4747 Value :: Float ( _) => ConstantType :: Float64 ,
4848 Value :: Date32 ( _) => ConstantType :: Date ,
49+ Value :: Decimal128 ( _) => ConstantType :: Decimal ,
4950 _ => unimplemented ! ( "get_data_type_from_value() not implemented for value {value}" ) ,
5051 }
5152 }
You can’t perform that action at this time.
0 commit comments