Skip to content
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

Closed

Conversation

Weijun-H
Copy link
Member

@Weijun-H Weijun-H commented Mar 20, 2024

Which issue does this PR close?

Closes #9706

Rationale for this change

  • move array_except to SetOp
  • support Null columnar for array set opertaion

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

columnar in array_except, array_union and array_intersect
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Mar 20, 2024
let mut r_values = converter.convert_columns(&[second_arr])?;

if set_op == SetOp::Except {
(l_values, r_values) = (r_values, l_values);
Copy link
Contributor

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
Copy link
Contributor

@jayzhan211 jayzhan211 Mar 21, 2024

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 Weijun-H requested a review from jayzhan211 March 21, 2024 04:31
@jayzhan211
Copy link
Contributor

@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.


offsets.push(last_offset + OffsetSize::usize_as(rows.len()));
let arrays = converter.convert_rows(rows)?;
let array = match arrays.first() {
Copy link
Contributor

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)

@Weijun-H
Copy link
Member Author

@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

@jayzhan211
Copy link
Contributor

jayzhan211 commented Mar 21, 2024 via email

@alamb
Copy link
Contributor

alamb commented Mar 29, 2024

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)

@alamb alamb marked this pull request as draft March 29, 2024 15:02
@alamb
Copy link
Contributor

alamb commented Mar 29, 2024

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

Copy link

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.

@github-actions github-actions bot added the Stale PR has not had any activity for some time label May 29, 2024
@github-actions github-actions bot closed this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt) Stale PR has not had any activity for some time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

array_union and array_intersect cannot handle NULL columnar data
3 participants