-
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
fix: move array_except in SetOp and support Null columnar in array_except
, array_union
and array_intersect
#9710
Conversation
columnar in array_except, array_union and array_intersect
let mut r_values = converter.convert_columns(&[second_arr])?; | ||
|
||
if set_op == SetOp::Except { | ||
(l_values, r_values) = (r_values, l_values); |
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 think mixing the logic of except here make it less readable 😕
@@ -405,6 +405,18 @@ AS VALUES | |||
(arrow_cast(make_array([5,6], [5,6], NULL, NULL, NULL), 'FixedSizeList(5, List(Int64))')) | |||
; | |||
|
|||
statement ok | |||
CREATE TABLE array_setop_with_NULL_table |
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.
you can name it array_setop
for all the setop functions, because we don't need special non-null table
@Weijun-H I think the common logic for them is not large enough to worth mixing into one function. Do you think separate the function for them is easier for understanding the code? I'm even thinking of |
|
||
offsets.push(last_offset + OffsetSize::usize_as(rows.len())); | ||
let arrays = converter.convert_rows(rows)?; | ||
let array = match arrays.first() { |
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 recently learn swap_remove
, I think we can apply here without clone. arrays.swap_remove(0)
The three function logic structures are similar, so I think they should be merged into one. @jayzhan211 |
How about extract the common to function. And, try to let the logic for one
stay close together.
One of issue I think that make it less readable is that for example array
except, we need to go through several if else statements that is unrelated
(union or intersect), and even swapping for the common function.
I think I need suggestions from others too, maybe it is easy to read for
others.
…On Thu, Mar 21, 2024, 6:14 PM Alex Huang ***@***.***> wrote:
@Weijun-H <https://github.com/Weijun-H> I think the common logic for them
is not large enough to worth mixing into one function. Do you think
separate the function for them is easier for understanding the code? I'm
even thinking of union and intersect too.
The three function logic structures are similar, so I think they should be
merged into one. @jayzhan211 <https://github.com/jayzhan211>
—
Reply to this email directly, view it on GitHub
<#9710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZCLR2LQ46JY6UGPDDTGJTYZKXKDAVCNFSM6AAAAABE7XPNPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRHAZTGMZYGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What is the status of this PR ? it isn't clear to me if it was waiting on more feedback I saw it did several changes at once (like both move code and add features) which meant it was hard for me to find enough time to review. If there is still work to be done, perhaps we can do the changes in two PRs (move the code, and then fix / add functionality) |
Marking as draft as I think this PR is no longer waiting on feedback. Please mark it as ready for review when it is ready for another look |
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days. |
Which issue does this PR close?
Closes #9706
Rationale for this change
array_except
to SetOpWhat changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?