somu-imply commented on code in PR #13799:
URL: https://github.com/apache/druid/pull/13799#discussion_r1116363049
##########
processing/src/main/java/org/apache/druid/segment/UnnestStorageAdapter.java:
##########
@@ -73,20 +67,24 @@ public Sequence<Cursor> makeCursors(
@Nullable QueryMetrics<?> queryMetrics
)
{
- Filter updatedFilter;
- if (allowSet != null && !allowSet.isEmpty()) {
- final InDimFilter allowListFilters;
- allowListFilters = new InDimFilter(dimensionToUnnest, allowSet);
- if (filter != null) {
- updatedFilter = new AndFilter(Arrays.asList(filter, allowListFilters));
- } else {
- updatedFilter = allowListFilters;
- }
+ // the filter on the outer unnested column needs to be recreated on the
unnested dimension and sent into
+ // the base cursor
+ // currently testing it out for in filter and selector filter
+ // TBD: boun
+
+ final Filter forBaseFilter;
+ if (filter == null) {
+ forBaseFilter = filter;
} else {
- updatedFilter = filter;
+ // if the filter has the unnested column
+ // do not pass it into the base cursor
+ // if there is a filter as d2 > 1 and unnest-d2 < 10
+ // Calcite would push the filter on d2 into the data source
+ // and only the filter on unnest-d2 < 10 will appear here
+ forBaseFilter = filter.getRequiredColumns().contains(outputColumnName) ?
null : filter;
Review Comment:
I'll add more comment. d2 is the column to be unnested. What I mean is that
all filters on columns that exist in the datasource are pushed on to the data
source. Only the filters on the unnested column appears here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]