somu-imply commented on code in PR #15020:
URL: https://github.com/apache/druid/pull/15020#discussion_r1332545720
##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:
##########
@@ -788,6 +790,24 @@ static Pair<DataSource, Filtration> getFiltration(
{
if (!canUseIntervalFiltering(dataSource)) {
return Pair.of(dataSource, toFiltration(filter,
virtualColumnRegistry.getFullRowSignature(), false));
+ } else if (dataSource instanceof UnnestDataSource) {
+ // UnnestDataSource can have another unnest data source
+ // join datasource, filtered data source, etc as base
+ Pair<DataSource, Filtration> pair = getFiltration(
+ ((UnnestDataSource) dataSource).getBase(),
+ filter,
+ virtualColumnRegistry,
+ joinableFactoryWrapper
+ );
+ return Pair.of(dataSource, pair.rhs);
+ } else if (dataSource instanceof FilteredDataSource) {
+ final FilteredDataSource filteredDataSource = (FilteredDataSource)
dataSource;
+ final Filtration baseFiltration =
Filtration.create(filteredDataSource.getFilter())
+
.optimize(virtualColumnRegistry.getFullRowSignature());
Review Comment:
This could be replaced by a call as follows
```
final boolean status = canUseIntervalFiltering(filteredDataSource);
final Filtration baseFiltration =
toFiltration(filteredDataSource.getFilter(),
virtualColumnRegistry.getFullRowSignature(), status);
```
The `toFiltration` has handling for choosing the correct path based on the
status
--
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]