Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 225753d

Browse files
committed
Match statement extensions to run TPC-H Q18 (plan still sucks too much)
1 parent 271d288 commit 225753d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

optd-core/src/nodes.rs

+10-1
Original file line numberDiff line numberDiff 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
}

optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs

+1
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)