-
Notifications
You must be signed in to change notification settings - Fork 1.9k
add integration tests for rank, dense_rank, fix last_value evaluation with rank #638
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
Conversation
091ca96 to
c6e4fd0
Compare
10e07a9 to
7049b4e
Compare
8a90c61 to
617190d
Compare
5f166a0 to
c3b12c1
Compare
| order by c9 \ | ||
| limit 5"; | ||
| let actual = execute(&mut ctx, sql).await; | ||
| let expected = vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-[ RECORD 1 ]-----------------------
c9 | 28774375
sum | 61035129
avg | 61035129.000000000000
count | 1
max | 61035129
min | 61035129
first_value | 61035129
last_value | 61035129
nth_value | ¤
-[ RECORD 2 ]-----------------------
c9 | 63044568
sum | -47938237
avg | -23969118.500000000000
count | 2
max | 61035129
min | -108973366
first_value | 61035129
last_value | -108973366
nth_value | -108973366
-[ RECORD 3 ]-----------------------
c9 | 141047417
sum | 575165281
avg | 191721760.33333333
count | 3
max | 623103518
min | -108973366
first_value | 61035129
last_value | 623103518
nth_value | -108973366
-[ RECORD 4 ]-----------------------
c9 | 141680161
sum | -1352462829
avg | -338115707.25000000
count | 4
max | 623103518
min | -1927628110
first_value | 61035129
last_value | -1927628110
nth_value | -108973366
-[ RECORD 5 ]-----------------------
c9 | 145294611
sum | -3251637940
avg | -650327588.00000000
count | 5
max | 623103518
min | -1927628110
first_value | 61035129
last_value | -1899175111
nth_value | -108973366
c3b12c1 to
724b2bf
Compare
724b2bf to
5b68cbb
Compare
|
@alamb and @Dandandan this pull request is ready now |
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. Nice work @jimexist
| .iter() | ||
| .map(|range| { | ||
| let len = range.end - range.start; | ||
| let value = ScalarValue::try_from_array(arr, range.end - 1)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very cool
| // because the default window frame is between unbounded preceding and current | ||
| // row, hence the shift because for values with indices < index they should be | ||
| // null. This changes when window frames other than default is implemented | ||
| shift(arr.as_ref(), index as i64).map_err(DataFusionError::ArrowError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…-compatible DataFusion expressions (apache#638) * convert into workspace project * update GitHub actions * update Makefile * fix regression * update target path * update protobuf path in pom.xml * update more paths * add new datafusion-comet-expr crate * rename CometAbsFunc to Abs and add documentation * fix error message * improve error handling * update crate description * remove unused dep * address feedback * finish renaming crate * update README for datafusion-spark-expr * rename crate to datafusion-comet-spark-expr
…-compatible DataFusion expressions (apache#638) * convert into workspace project * update GitHub actions * update Makefile * fix regression * update target path * update protobuf path in pom.xml * update more paths * add new datafusion-comet-expr crate * rename CometAbsFunc to Abs and add documentation * fix error message * improve error handling * update crate description * remove unused dep * address feedback * finish renaming crate * update README for datafusion-spark-expr * rename crate to datafusion-comet-spark-expr
Which issue does this PR close?
add integration tests for rank, dense_rank, fix last_value evaluation with rank
Closes follow ups on #555
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?