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

Report columns covered by a Dynamic Filter #9644

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

findepi
Copy link
Member

@findepi findepi commented Oct 14, 2021

This allows a connector to make decision whether to wait for a filter or
not.

@cla-bot cla-bot bot added the cla-signed label Oct 14, 2021
@findepi
Copy link
Member Author

findepi commented Oct 14, 2021

@findepi findepi force-pushed the findepi/introspectible-df branch from edd52b0 to e16a0ae Compare October 14, 2021 20:30
@findepi findepi marked this pull request as ready for review October 15, 2021 11:10

Set<ColumnHandle> columnsCovered = descriptors.stream()
.map(Descriptor::getInput)
.map(SymbolsExtractor::extractUnique) // TODO can input be something else than SymbolReference? future's code above assumes not
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to use DynamicFilters#extractSourceSymbol

Copy link
Member Author

Choose a reason for hiding this comment

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

i will use extractSourceSymbol in the code here, thanks.
but is the code above (preexisting) correct?

Copy link
Member

Choose a reason for hiding this comment

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

Existing code is relying extractSourceSymbols which uses DynamicFilters#extractSourceSymbol internally. RemoveUnsupportedDynamicFilters#isSupportedDynamicFilterExpression should ensure that the condition there is satisfied.

Copy link
Member

Choose a reason for hiding this comment

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

but is the code above (preexisting) correct?

Yes. The code above operates on descriptorMap = extractSourceSymbols(descriptors) which unwraps cast

Copy link
Member Author

Choose a reason for hiding this comment

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

i wouldn't find this myself, thanks. to me it seems like extractSourceSymbols creates a "fake" Descriptor.

Copy link
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

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

lgtm % @raunaqmorarka comments


Set<ColumnHandle> columnsCovered = descriptors.stream()
.map(Descriptor::getInput)
.map(SymbolsExtractor::extractUnique) // TODO can input be something else than SymbolReference? future's code above assumes not
Copy link
Member

Choose a reason for hiding this comment

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

but is the code above (preexisting) correct?

Yes. The code above operates on descriptorMap = extractSourceSymbols(descriptors) which unwraps cast

@@ -476,6 +503,8 @@ public void close()
@Override
public boolean isFinished()
{
assertEquals(dynamicFilter.getColumnsCovered(), expectedDynamicFilterColumnsCovered, "columns covered");
Copy link
Member

Choose a reason for hiding this comment

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

the check in constructor should is sufficient

Copy link
Member Author

Choose a reason for hiding this comment

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

i want to test that getColumnsCovered remains correct.

@@ -514,6 +545,8 @@ public ConnectorPageSource createPageSource(
@Override
public boolean isFinished()
{
assertEquals(dynamicFilter.getColumnsCovered(), expectedDynamicFilterColumnsCovered, "columns covered");
Copy link
Member

Choose a reason for hiding this comment

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

check in constructor should is sufficient

Copy link
Member Author

Choose a reason for hiding this comment

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

i want to test that getColumnsCovered remains correct.

@Override
public Set<ColumnHandle> getColumnsCovered()
{
return tupleDomain.getDomains().map(Map::keySet)
Copy link
Member

Choose a reason for hiding this comment

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

empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sopel39 what do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

why not return empty array here

Copy link
Member Author

Choose a reason for hiding this comment

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

we're given a tupleDomain here, so returning empty set would not be correct, would it be?

@findepi findepi force-pushed the findepi/introspectible-df branch from 8076368 to 10c1c38 Compare October 15, 2021 15:43
This allows a connector to make decision whether to wait for a filter or
not.
@findepi findepi force-pushed the findepi/introspectible-df branch from 10c1c38 to 89761e8 Compare October 15, 2021 17:56
@findepi findepi merged commit 67562fa into trinodb:master Oct 15, 2021
@findepi findepi deleted the findepi/introspectible-df branch October 15, 2021 19:41
@findepi findepi added the enhancement New feature or request label Oct 15, 2021
@findepi findepi mentioned this pull request Oct 15, 2021
12 tasks
@github-actions github-actions bot added this to the 364 milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants