vrajat commented on code in PR #15773:
URL: https://github.com/apache/pinot/pull/15773#discussion_r2113930618


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/timeboundary/MinTimeBoundaryStrategy.java:
##########
@@ -36,37 +37,42 @@
 @AutoService(TimeBoundaryStrategy.class)
 public class MinTimeBoundaryStrategy implements TimeBoundaryStrategy {
 
-  public static final String INCLUDED_TABLES = "includedTables";
+  private static final String INCLUDED_TABLES = "includedTables";
+  Map<String, DateTimeFormatSpec> _dateTimeFormatSpecMap;
+
+  @Override
+  public void init(LogicalTableConfig logicalTableConfig, TableCache 
tableCache) {
+    Map<String, Object> parameters = 
logicalTableConfig.getTimeBoundaryConfig().getParameters();
+    List<String> includedTables = 
getTimeBoundaryTableNames(logicalTableConfig);
+    _dateTimeFormatSpecMap = new HashMap<>(includedTables.size());
+    for (String physicalTableName : includedTables) {
+      String rawTableName = 
TableNameBuilder.extractRawTableName(physicalTableName);
+      Schema schema = tableCache.getSchema(rawTableName);
+      TableConfig tableConfig = tableCache.getTableConfig(physicalTableName);
+      Preconditions.checkArgument(tableConfig != null, "Table config not found 
for table: %s", physicalTableName);
+      Preconditions.checkArgument(schema != null, "Schema not found for table: 
%s", physicalTableName);
+      String timeColumnName = 
tableConfig.getValidationConfig().getTimeColumnName();
+      DateTimeFieldSpec dateTimeFieldSpec = 
schema.getSpecForTimeColumn(timeColumnName);
+      Preconditions.checkArgument(dateTimeFieldSpec != null, "Time column not 
found in schema for table: %s",
+          physicalTableName);
+      DateTimeFormatSpec specFormatSpec = dateTimeFieldSpec.getFormatSpec();
+      _dateTimeFormatSpecMap.put(physicalTableName, specFormatSpec);
+    }
+  }
 
   @Override
   public String getName() {
     return "min";
   }
 
   @Override
-  public TimeBoundaryInfo computeTimeBoundary(LogicalTableConfig 
logicalTableConfig, TableCache tableCache,
-      RoutingManager routingManager) {
+  public TimeBoundaryInfo computeTimeBoundary(RoutingManager routingManager) {

Review Comment:
   It is related. These APIs were over-fitted for SSE request handler logic 
where it has both table cache and routing manager. So only function was 
required.
   
   In MSE, the logic is split. MSE checks table cache in one section and 
routing manager in another section. So the function had to be broken down. You 
will notice a similar break up in `ImplicitHybridTableRouteProvider` and 
`LogicalTableRouteProvider`



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to