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

Minor: reduce replication for nested comparison #11149

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jun 27, 2024

Which issue does this PR close?

Follow on to #11117

Rationale for this change

@jayzhan211 had a suggestion on how to simplify the implementation in #11117 (comment) from @rtyler .

What changes are included in this PR?

Use a pre-existing function to compare structured types

Are these changes tested?

Covered by existing tests (added in #11117)

Are there any user-facing changes?

let values = (0..len).map(|i| cmp(i, i).is_eq()).collect();
let nulls = NullBuffer::union(left.nulls(), right.nulls());
return Ok(BooleanArray::new(values, nulls));
return Ok(compare_op_for_nested(&Operator::Eq, &left, &right)?);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the point of the PR is to use the pre-existing function that already handles this

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 we can use apply_cmp_for_nested and keep compare_op_for_nested private here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I used compare_op_for_nested was that apply_cmp_for_nested returns a ColumnarValue and this function has to &dyn Arrays

@alamb
Copy link
Contributor Author

alamb commented Jun 28, 2024

Thank you @rtyler and @jayzhan211 for the reviews

@alamb alamb merged commit 57280e4 into apache:main Jun 28, 2024
24 of 25 checks passed
@alamb alamb deleted the alamb/cleaner_check branch June 28, 2024 00:26
comphead pushed a commit to comphead/arrow-datafusion that referenced this pull request Jul 2, 2024
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants