kgyrtkirk commented on code in PR #20607:
URL: https://github.com/apache/druid/pull/20607#discussion_r4322515631


##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:
##########
@@ -817,11 +817,16 @@ VirtualColumns computeVirtualColumns(final boolean 
includeDimensions)
    * Returns a pair of DataSource and Filtration object created on the query 
filter. In case the data source is
    * a join datasource, the datasource may be altered and left filter of join 
datasource may
    * be rid of time filters.
+   *
+   * @param timeCondition intervals to AND with the filtration intervals if 
the datasource is table-based, from
+   *                      {@link PlannerContext#getTimeCondition()}. Must be 
sorted and non-overlapping. Null means

Review Comment:
   I think the source of a detail like this should not matter at this point



##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:
##########
@@ -817,11 +817,16 @@ VirtualColumns computeVirtualColumns(final boolean 
includeDimensions)
    * Returns a pair of DataSource and Filtration object created on the query 
filter. In case the data source is
    * a join datasource, the datasource may be altered and left filter of join 
datasource may
    * be rid of time filters.
+   *
+   * @param timeCondition intervals to AND with the filtration intervals if 
the datasource is table-based, from
+   *                      {@link PlannerContext#getTimeCondition()}. Must be 
sorted and non-overlapping. Null means
+   *                      no additional condition.
    */
   @VisibleForTesting
   static Pair<DataSource, Filtration> getFiltration(
       DataSource dataSource,
       DimFilter filter,
+      @Nullable List<Interval> timeCondition,

Review Comment:
   instead of a new argument to a lot of things; couldn't this be folded into 
the filter and then let the system recognize it like in other cases?
   
   ....or how about instead of passing it around transform all datasources of 
the queries into filtereddatasource?
   
   I also wonder what would be the logical equiv of this:
   * I think this could be viewed that all tables have logical column like: 
`__phantom_time` ; which applies to the subtree
   * this condition is applies to the `__phantom_time` column
   * the `__phantom_time` conditions should be pushed down to all leaf filters; 
regardless the intermediate nodes (rewrite shuttle) and turned into `__time` 
   * this `__phantom_time` column is conceptual - if it would have no value 
exposing it could be skipped entirely; the shuttle would be enough
   
   
   
   
   



-- 
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]

Reply via email to