gortiz commented on code in PR #12591:
URL: https://github.com/apache/pinot/pull/12591#discussion_r1528284373


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/catalog/PinotCatalog.java:
##########
@@ -44,14 +50,46 @@
  */
 public class PinotCatalog implements Schema {
 
+  public static final String DEFAULT_DB_NAME = "default";
+
   private final TableCache _tableCache;
 
+  private final Map<String, CalciteSchema> _subCatalog;
+
+  private final String _databaseName;
+
   /**
    * PinotCatalog needs have access to the actual {@link TableCache} object 
because TableCache hosts the actual
    * table available for query and processes table/segment metadata updates 
when cluster status changes.
    */
   public PinotCatalog(TableCache tableCache) {
     _tableCache = tableCache;
+    _databaseName = null;
+    // create all databases
+    // TODO: we need to monitor table cache changes to register newly created 
databases
+    // TODO: we also need to monitor table that needs to be put into the right 
places
+    _subCatalog = constructSubCatalogs(_tableCache);
+  }
+
+  private PinotCatalog(String databaseName, TableCache tableCache) {
+    _tableCache = tableCache;
+    _databaseName = databaseName;
+    _subCatalog = null;
+  }
+
+  private Map<String, CalciteSchema> constructSubCatalogs(TableCache 
tableCache) {
+    Map<String, CalciteSchema> subCatalog = new HashMap<>();
+    for (String physicalTableName : tableCache.getTableNameMap().keySet()) {
+      String[] nameSplit = StringUtils.split(physicalTableName, '.');

Review Comment:
   So before the option was deprecated table names could either:
     * Do no have `.` in their name
     * Or have a single `.` in their name, in which case it was used to 
identify the _database_
   
   And now, independent of that property, table names may have a single `.` in 
their name, in which case it was used to identify the _database_.
   
   Then I guess it is not backward incompatible.



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