This repository was archived by the owner on Jan 7, 2025. It is now read-only.
File tree 2 files changed +11
-1
lines changed
optd-datafusion-repr/src/plan_nodes/predicates
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,16 @@ impl Value {
211
211
}
212
212
_ => panic ! ( "{self} could not be converted into an Date32" ) ,
213
213
} ) ,
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
+ ) ,
215
224
}
216
225
}
217
226
}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ impl ConstantType {
46
46
Value :: Int64 ( _) => ConstantType :: Int64 ,
47
47
Value :: Float ( _) => ConstantType :: Float64 ,
48
48
Value :: Date32 ( _) => ConstantType :: Date ,
49
+ Value :: Decimal128 ( _) => ConstantType :: Decimal ,
49
50
_ => unimplemented ! ( "get_data_type_from_value() not implemented for value {value}" ) ,
50
51
}
51
52
}
You can’t perform that action at this time.
0 commit comments