buraksenn commented on PR #13201:
URL: https://github.com/apache/datafusion/pull/13201#issuecomment-2454209975
> > External error: query failed: DataFusion error: Arrow error: Invalid
argument error: It is not possible to concatenate arrays of different data
types.
>
> In the built-in (older) version the output field is defined like:
>
> ```rust
> fn field(&self) -> Result<Field> {
> let nullable = true;
> Ok(Field::new(&self.name, self.data_type.clone(), nullable))
> }
> ```
>
> In the current code, the data type of the field is hard-coded as
`DataType::UInt64`:
>
> ```rust
> fn field(&self, field_args: WindowUDFFieldArgs) -> Result<Field> {
> let nullable = true;
>
> Ok(Field::new(field_args.name(), DataType::UInt64, nullable))
> }
> ```
>
> To fix this use `field_args` to get the data type of the input expression
rather than hard-coding `DataType::UInt64`.
Thanks, @jcsherin that was the fix. I've fixed that issue but encountered
another one. I return Error from partition evaluator but I think it is not
honored.
```
External error: query is expected to fail, but actually succeed:
[SQL] SELECT NTH_VALUE('+Inf'::Double, v1) OVER (PARTITION BY v1) FROM t1;
at test_files/window.slt:4895
Error: Execution("1 failures")
error: test failed, to rerun pass `-p datafusion-sqllogictest --test
sqllogictests`
Caused by:
process didn't exit successfully:
`/Users/buraksen/d/datafusion/target/debug/deps/sqllogictests-267639e9b963ccc2
window` (exit status: 1)
```
But it should not succeed since:
```
let n =
match
get_scalar_value_from_args(partition_evaluator_args.input_exprs(), 1)?
.map(get_signed_integer)
{
Some(Ok(n)) => {
if partition_evaluator_args.is_reversed() {
-n
} else {
n
}
}
_ => {
return exec_err!(
"Expected a signed integer literal for the second argument
of nth_value"
)
}
};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]