-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
casting Int64
to Float64
unsuccessfully caused tpch8 to fail
#1576
Comments
I've found out why it failed. let's see query 8, there is select
o_year,
sum(case
when nation = 'BRAZIL' then volume
else 0
end) / sum(volume) as mkt_share
... In datafusion, the following code to process fn if_then_else(
bools: &BooleanArray,
true_values: ArrayRef,
false_values: ArrayRef,
data_type: &DataType,
) -> Result<ArrayRef> {
match data_type {
...
DataType::Float64 => if_then_else!(
array::Float64Builder,
array::Float64Array,
bools,
true_values,
false_values
),
}
} In query8, 0 is macro_rules! if_then_else {
($BUILDER_TYPE:ty, $ARRAY_TYPE:ty, $BOOLS:expr, $TRUE:expr, $FALSE:expr) => {{
let true_values = $TRUE
.as_ref()
.as_any()
.downcast_ref::<$ARRAY_TYPE>()
.expect("true_values downcast failed");
let false_values = $FALSE
.as_ref()
.as_any()
.downcast_ref::<$ARRAY_TYPE>()
.expect("false_values downcast failed"); There are two potential approaches to solve the issue
|
I think it would be most appropriate to have datafusion do the conversion (coercion) in this case, rather than implicitly in arrow. Perhaps by calling |
Thanks @alamb , I'll try it |
Describe the bug
During running tpch8, I got the following error:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: