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_r283833595
 
 

 ##########
 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:
   I agree we should not get pulled into the discussion around yaml file. It's 
irrelevant from the perspective of these ctor. We can any arbitrary logic in 
the `CatalogFactory`.
   
   I still believe thought from the clean code perspective we should allow for 
passing a CatalogDatabase (or GenericInMemoryCatalogDatabse if we want to limit 
the scope) in the ctor. Such approach helps to write a testable 
code(http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf or 
 http://misko.hevery.com/code-reviewers-guide/) (which in turn is easier to 
use, as tests also verify that the interfaces are usable). I see no reason why 
we should not allow for that. 
   
   But in the end I will leave it for your call.

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

Reply via email to