gortiz commented on code in PR #12591:
URL: https://github.com/apache/pinot/pull/12591#discussion_r1526605522
##########
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 it is not backward compatible, right? :D
We need to document that very well.
At the same time, as I said otherwise, in SQL schemas (which is what we are
implementing here) can be recursive, so more than one `.` should be also
reserved.
At the same time there is a standard SQL way to add this characters and is
to use specify the table name within double quotes.
--
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]