dawidwys commented on a change in pull request #8390: [FLINK-12469][table]
Clean up catalog API on default/current database
URL: https://github.com/apache/flink/pull/8390#discussion_r282904007
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/GenericInMemoryCatalog.java
##########
@@ -65,9 +64,15 @@
private final Map<ObjectPath, Map<CatalogPartitionSpec,
CatalogColumnStatistics>> partitionColumnStats;
public GenericInMemoryCatalog(String name) {
+ this(name, DEFAULT_DB);
+ }
+
+ public GenericInMemoryCatalog(String name, String defaultDatabase) {
Review comment:
No, what I mean is to allow user to provide the defaultDB. In other words to
have a ctor that does not create the defaultDb, but uses the one provided by
the user.
So the ctor would like:
```
public GenericInMemoryCatalog(String name, String defaultDbName,
CatalogDatabase defaultDb) {
checkArgument(!StringUtils.isNullOrWhitespaceOnly(name), "name
cannot be null or empty");
this.currentDatabase = defaultDbName;
this.catalogName = name;
this.databases = new LinkedHashMap<>();
this.databases.put(defaultDbName, defaultDb);
this.tables = new LinkedHashMap<>();
this.functions = new LinkedHashMap<>();
this.partitions = new LinkedHashMap<>();
this.tableStats = new LinkedHashMap<>();
this.tableColumnStats = new LinkedHashMap<>();
this.partitionStats = new LinkedHashMap<>();
this.partitionColumnStats = new LinkedHashMap<>();
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services