Skip to content

Commit

Permalink
Extra decimal support for TPC-H Q18 (#261)
Browse files Browse the repository at this point in the history
Regrettably the query is still too slow...

Would like a sanity check on this in any case.

Won't merge until unnest-exists is merged
  • Loading branch information
jurplel authored Dec 18, 2024
1 parent 6db922d commit b4b1aea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion optd-core/src/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
}
}
Expand Down

0 comments on commit b4b1aea

Please sign in to comment.