wuchong commented on a change in pull request #10563: [FLINK-15232][table] 
Message of NoMatchingTableFactoryException should tell users what's wrong
URL: https://github.com/apache/flink/pull/10563#discussion_r358038244
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
 ##########
 @@ -269,16 +271,67 @@
                        plainContext.remove(CATALOG_PROPERTY_VERSION);
 
                        // check if required context is met
-                       return plainContext.keySet()
-                               .stream()
-                               .allMatch(e -> properties.containsKey(e) && 
properties.get(e).equals(plainContext.get(e)));
-               }).collect(Collectors.toList());
+                       int matchedSize = 0;
+                       Map<String, Tuple2<String, String>> unMatchedProperties 
= new HashMap<>();
+                       for (Map.Entry<String, String> e : 
plainContext.entrySet()) {
+                               if (properties.containsKey(e.getKey()) &&
+                                               
properties.get(e.getKey()).equals(e.getValue())) {
+                                       matchedSize++;
 
 Review comment:
   The `matchedSize` can be calculated by `userProperties.size() - 
unMatchedProperties.size()`.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to