Skip to content

Use TupleDomain#intersect for List<TupleDomain> in DynamicFilterService#10700

Merged
sopel39 merged 1 commit intotrinodb:masterfrom
raunaqmorarka:list-intersect
Jan 24, 2022
Merged

Use TupleDomain#intersect for List<TupleDomain> in DynamicFilterService#10700
sopel39 merged 1 commit intotrinodb:masterfrom
raunaqmorarka:list-intersect

Conversation

@raunaqmorarka
Copy link
Copy Markdown
Member

@raunaqmorarka raunaqmorarka commented Jan 20, 2022

Allow single element list in TupleDomain#intersect to make it's usage easier.
Using the direct API for intersecting lists can be more efficient than
intersecting two elements at a time.

@findepi
Copy link
Copy Markdown
Member

findepi commented Jan 20, 2022

@raunaqmorarka please add to TestTupleDomain

Allowed single element and empty list in TupleDomain#intersect
to make it's usage easier.
Using the direct API for intersecting lists can be more efficient than
intersecting two elements at a time.
@raunaqmorarka
Copy link
Copy Markdown
Member Author

@raunaqmorarka please add to TestTupleDomain

added tests in TestTupleDomain


assertEquals(TupleDomain.intersect(ImmutableList.of()), all());
assertEquals(TupleDomain.intersect(ImmutableList.of(tupleDomain1)), tupleDomain1);
assertEquals(TupleDomain.intersect(ImmutableList.of(tupleDomain1, tupleDomain2)), expectedTupleDomain);
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.

yikes, we had no tests here for TupleDomain.intersect(List)... thanks for adding them!

@sopel39 sopel39 merged commit ca0946b into trinodb:master Jan 24, 2022
@sopel39
Copy link
Copy Markdown
Member

sopel39 commented Jan 24, 2022

This probably does not need RN

@github-actions github-actions bot added this to the 369 milestone Jan 24, 2022
@raunaqmorarka raunaqmorarka deleted the list-intersect branch January 24, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants