mustafasrepo commented on issue #5346:
URL:
https://github.com/apache/arrow-datafusion/issues/5346#issuecomment-1441631579
I have debugged this problem. It originates when value of `RANGE` cannot be
casted to type used in the `ORDER BY` column. The reason above test passes in
rust and not in cli is that, In rust test cases for c2 column we use `Uint32`,
whereas in cli test `Int8` is used. Below, test reproduces the issue in rust.
```
#[tokio::test]
async fn window_frame_large_range() -> Result<()> {
let ctx = SessionContext::new();
register_aggregate_csv(&ctx).await?;
// 10000 is outside the valid range for Int8 (type of c3). In this case
we should be able to still produce correct result.
// See issue: https://github.com/apache/arrow-datafusion/issues/5346
let sql = "SELECT
SUM(c3) OVER(ORDER BY c3 DESC RANGE BETWEEN 10000 PRECEDING
AND 10000 FOLLOWING) as summation1
FROM aggregate_test_100
ORDER BY c9
LIMIT 5";
let actual = execute_to_batches(&ctx, sql).await;
let expected = vec![
"+------------+",
"| summation1 |",
"+------------+",
"| 781 |",
"| 781 |",
"| 781 |",
"| 781 |",
"| 781 |",
"+------------+",
];
assert_batches_eq!(expected, &actual);
Ok(())
}
```
--
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]