You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/16 02:41:54 UTC

[GitHub] [flink] JingsongLi commented on a change in pull request #10563: [FLINK-15232][table] Message of NoMatchingTableFactoryException should tell users what's wrong

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

 ##########
 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:
   No, they are different size.
   For example, there are two factories: A with 100 properties and B with 10 properties.
   Maybe we matched 2 for A and 8 for B, we need choose B, but `unMatchedProperties` of A will be more.
   Of course we can check value of `unMatchedProperties`, but I don't want to make it complex.

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


With regards,
Apache Git Services