-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactor(sqllogictests): port group by test to sqllogic #6088
Conversation
Thank you @aprimadi -- we really appreciate the help |
Not sure if we should port group_by_dictionary test case @alamb. It seems that if we port it into sqllogic, the test would be longer. While doing it programmatically seems to be very concise. |
This is probably enough for now, all the other tests use a one-time-use test data. |
} | ||
|
||
/// Create and populate time32_s, time32_ms, time64_us, time64_ns tables | ||
fn register_time_test_tables(ctx: &SessionContext) { |
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.
I don't think you need rust code to do this setup anymore
You can create arbitrary Arrow types that have no corresponding SQL types with the arrow_cast
function -- https://arrow.apache.org/datafusion/user-guide/sql/data_types.html
For example, here is one way to do it:
https://github.com/apache/arrow-datafusion/blob/7759d96e892e7c159136af35ebc0def49ed3b3b1/datafusion/core/tests/sqllogictests/test_files/timestamps.slt#L113-L129
So you can make a value of Time32(Seconds)
with something like
❯ select arrow_cast(5000::int, 'Time32(Second)');
+-------------+
| Int64(5000) |
+-------------+
| 01:23:20 |
+-------------+
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.
Alright, thank you for the feedback @alamb. Didn't know that. I'm done for the day, will probably work more on this tomorrow if nothing comes up.
@alamb not sure how to port group_by_date_trunc and group_by_dictionary without writing setup code. Do we want to migrate those also? |
My idea is mainly based on these two test cases and what they cover.
|
I think both For For IMO, the data setup should be as close to the code that test it except if it's being used multiple times. |
Btw,, those are the only two tests from group_by.rs not being moved to sqllogic. |
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.
Looks good to me . Thank you @aprimadi
It looks like we can eventually consolidate group_by and aggregate.slt 🤔
I really appreciate the help @aprimadi ❤️ |
Which issue does this PR close?
Port group by tests from group_by.rs.
Work towards #4495
Rationale for this change
N/A
What changes are included in this PR?
N/A
Are these changes tested?
Yes
Are there any user-facing changes?
No