-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
edd52b0
to
e16a0ae
Compare
|
||
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 |
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 think we need to use DynamicFilters#extractSourceSymbol
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 will use extractSourceSymbol
in the code here, thanks.
but is the code above (preexisting) correct?
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.
Existing code is relying extractSourceSymbols
which uses DynamicFilters#extractSourceSymbol
internally. RemoveUnsupportedDynamicFilters#isSupportedDynamicFilterExpression
should ensure that the condition there is satisfied.
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.
but is the code above (preexisting) correct?
Yes. The code above operates on descriptorMap = extractSourceSymbols(descriptors)
which unwraps cast
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 wouldn't find this myself, thanks. to me it seems like extractSourceSymbols
creates a "fake" Descriptor.
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 % @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 |
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.
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"); |
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 check in constructor should is sufficient
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 want to test that getColumnsCovered
remains correct.
@@ -514,6 +545,8 @@ public ConnectorPageSource createPageSource( | |||
@Override | |||
public boolean isFinished() | |||
{ | |||
assertEquals(dynamicFilter.getColumnsCovered(), expectedDynamicFilterColumnsCovered, "columns covered"); |
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.
check in constructor should is sufficient
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 want to test that getColumnsCovered
remains correct.
@Override | ||
public Set<ColumnHandle> getColumnsCovered() | ||
{ | ||
return tupleDomain.getDomains().map(Map::keySet) |
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.
empty?
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.
@sopel39 what do you mean?
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.
why not return empty array 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.
we're given a tupleDomain
here, so returning empty set would not be correct, would it be?
8076368
to
10c1c38
Compare
This allows a connector to make decision whether to wait for a filter or not.
10c1c38
to
89761e8
Compare
This allows a connector to make decision whether to wait for a filter or
not.