diff --git a/optd-core/src/nodes.rs b/optd-core/src/nodes.rs index f15d98e1..da30ba32 100644 --- a/optd-core/src/nodes.rs +++ b/optd-core/src/nodes.rs @@ -211,7 +211,16 @@ impl Value { } _ => panic!("{self} could not be converted into an Date32"), }), - _ => unimplemented!("Have not implemented convert_to_type for DataType {typ}"), + DataType::Decimal128(_, _) => Value::Decimal128(match self { + // TODO: Should we be ignoring the scale and precision here? + Value::Int128(i128) => *i128, + Value::Int64(i64) => (*i64).into(), + Value::Int32(i32) => (*i32).into(), + _ => panic!("{self} could not be converted into an Decimal128"), + }), + _ => unimplemented!( + "Have not implemented convert_to_type from {self} for DataType {typ}" + ), } } } diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs index c95c10e5..b8990620 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs @@ -46,6 +46,7 @@ impl ConstantType { Value::Int64(_) => ConstantType::Int64, Value::Float(_) => ConstantType::Float64, Value::Date32(_) => ConstantType::Date, + Value::Decimal128(_) => ConstantType::Decimal, _ => unimplemented!("get_data_type_from_value() not implemented for value {value}"), } }