-
Notifications
You must be signed in to change notification settings - Fork 298
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
[AMORO-2417] Support partition filter on optimizing plan #2436
[AMORO-2417] Support partition filter on optimizing plan #2436
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2436 +/- ##
============================================
- Coverage 52.93% 52.91% -0.02%
- Complexity 4420 4423 +3
============================================
Files 534 535 +1
Lines 30578 30618 +40
Branches 2994 2997 +3
============================================
+ Hits 16185 16202 +17
- Misses 13097 13132 +35
+ Partials 1296 1284 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
The code looks good to me, just some minor details need to be modified.
public void testUnkeyedConvertPartitionStructLikeToDataFilter() throws IOException { | ||
Assume.assumeTrue(getArcticTable().isUnkeyedTable()); | ||
UnkeyedTable table = getArcticTable().asUnkeyedTable(); | ||
logger.info("Partition Spec:" + getArcticTable().spec()); |
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.
Useless log.
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'm also not very clear about the necessity of printing logs here.
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.
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.
How about changing the test parameters rather than printing the log?
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.
core/src/test/java/com/netease/arctic/utils/TestKeyedExpressionUtil.java
Outdated
Show resolved
Hide resolved
...server/src/main/java/com/netease/arctic/server/optimizing/scan/KeyedTableFileScanHelper.java
Outdated
Show resolved
Hide resolved
…' into optimizing-plan-partition-filter
ams/server/src/main/java/com/netease/arctic/server/optimizing/plan/OptimizingPlanner.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
@HuangFru I left some comments, please take a look.
core/src/main/java/com/netease/arctic/utils/TablePropertyUtil.java
Outdated
Show resolved
Hide resolved
public void testUnkeyedConvertPartitionStructLikeToDataFilter() throws IOException { | ||
Assume.assumeTrue(getArcticTable().isUnkeyedTable()); | ||
UnkeyedTable table = getArcticTable().asUnkeyedTable(); | ||
logger.info("Partition Spec:" + getArcticTable().spec()); |
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'm also not very clear about the necessity of printing logs here.
ams/server/src/main/java/com/netease/arctic/server/optimizing/scan/TableFileScanHelper.java
Show resolved
Hide resolved
Fixed in the new commit. |
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.
LGTM.
* @param partitions the collection of partition data | ||
* @return data filter converted from partition data | ||
*/ | ||
public static Expression convertPartitionDataToDataFilter( |
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.
Both methods are named convertPartitionDataToDataFilter
. I think they can be distinguished.
* @param partition the partition data | ||
* @return data filter converted from partition data | ||
*/ | ||
public static Expression convertPartitionDataToDataFilter( |
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.
add @VisibleForTesting? This method is not referenced externally
Sorry, the PR has been merged into the master branch. Thanks for your review. Looks like some minor imperfections that maybe could be ignored? |
ok! |
* support partition filter on scan helper * apply spotless * fix comment * fix comment * fix comment * fix comment * fix comment * change test param --------- Co-authored-by: wangtaohz <103108928+wangtaohz@users.noreply.github.com>
Why are the changes needed?
Close #2417.
Brief change log
Pair<Integer, StructLike>
to represent the partition instead of a String.ExpressionUtil
used to convert partition data to a data filter and apply it as a partition filter.How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before making a pull request
Documentation