Skip to content

GH-48268: [C++][Acero] Enhance the type checking for hash join residual filter#48272

Merged
zanmato1984 merged 1 commit intoapache:mainfrom
zanmato1984:fix/gh-48268
Nov 29, 2025
Merged

GH-48268: [C++][Acero] Enhance the type checking for hash join residual filter#48272
zanmato1984 merged 1 commit intoapache:mainfrom
zanmato1984:fix/gh-48268

Conversation

@zanmato1984
Copy link
Copy Markdown
Contributor

@zanmato1984 zanmato1984 commented Nov 27, 2025

Rationale for this change

Type checking for hash join filter isn't enforced for some corner cases (literal filter expression). Some invalid tests are introduced.

What changes are included in this PR?

Enforce the type checking for all cases. Also fix the problematic test cases. Also refined the trivial residual filter handling in swiss join.

Are these changes tested?

Test included.

Are there any user-facing changes?

None.

return filter;
};

if (filter.IsBound()) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IsBound() is implied by literal(true) so one check should suffice.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose there's already a unit test for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not any particular test, but most existing tests exercise this path, both if true and if false. So I think we are good.

{
// Literal false, null, and scalar false, null.
for (Expression filter :
{literal(false), literal(NullScalar()), equal(literal(0), literal(1)),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The null type null (literal(NullScalar())) is invalid. Replacing it with a boolean type null.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Nov 27, 2025
@zanmato1984
Copy link
Copy Markdown
Contributor Author

This should fix the hash join test failure for big endian in #48166. cc @pitrou @Vishwanatha-HD

Copy link
Copy Markdown
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

+1, thanks @zanmato1984 . Just a question below.

return filter;
};

if (filter.IsBound()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose there's already a unit test for that?

@zanmato1984 zanmato1984 merged commit 6f62c2a into apache:main Nov 29, 2025
48 checks passed
@zanmato1984 zanmato1984 removed the awaiting committer review Awaiting committer review label Nov 29, 2025
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6f62c2a.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants