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

[spark] Support StringEndsWith filter in SparkFilterConverter #3714

Merged
merged 10 commits into from
Jul 11, 2024

Conversation

xuzifu666
Copy link
Member

@xuzifu666 xuzifu666 commented Jul 9, 2024

Purpose

Linked issue: close #3715

Tests

API and Format

Documentation

BinaryString minStr = (BinaryString) min;
BinaryString maxStr = (BinaryString) max;
BinaryString pattern = (BinaryString) patternLiteral;
return (minStr.endsWith(pattern) || minStr.compareTo(pattern) <= 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Really works? Can you add more tests?

Endswith does not support range filtering very well.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK,had add tests to test it. @JingsongLi

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 with @JingsongLi, does endWith really have any effect on range filtering?

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

You should add tests in PredicateTest.

@@ -192,6 +210,11 @@ public void testDate() {

@Test
public void testIgnoreFailure() {
testStartsWith();
Copy link
Contributor

Choose a reason for hiding this comment

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

No need modify this, this is only to test convertIgnoreFailure, regardless of the filter used

Copy link
Member Author

Choose a reason for hiding this comment

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

OK,removed the ut

BinaryString minStr = (BinaryString) min;
BinaryString maxStr = (BinaryString) max;
BinaryString pattern = (BinaryString) patternLiteral;
return (minStr.endsWith(pattern) || minStr.compareTo(pattern) <= 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 with @JingsongLi, does endWith really have any effect on range filtering?

@Zouxxyy
Copy link
Contributor

Zouxxyy commented Jul 10, 2024

By the way, since endwith has no range filtering capability, even we pass it to paimon, it has no filtering effect...

@Zouxxyy
Copy link
Contributor

Zouxxyy commented Jul 10, 2024

can add test for partition filering

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 9306dd8 into apache:master Jul 11, 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.

[Feature] Support StringEndsWith in SparkFilterConverter
3 participants