lirui-apache commented on a change in pull request #10157: [FLINK-14710][hive] 
Decide column nullability according to Hive const…
URL: https://github.com/apache/flink/pull/10157#discussion_r345584326
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV310.java
 ##########
 @@ -111,4 +112,28 @@ public void makeSpecFromName(Map<String, String> 
partSpec, Path currPath) {
                }
        }
 
+       @Override
+       public Set<String> getNotNullColumns(IMetaStoreClient client, 
Configuration conf, String dbName, String tableName) {
+               try {
+                       Method method = 
getMetaStoreUtilsClass().getDeclaredMethod("getDefaultCatalog", 
Configuration.class);
+                       String hiveDefaultCatalog = (String) 
method.invoke(null, conf);
+                       Class requestClz = 
Class.forName("org.apache.hadoop.hive.metastore.api.NotNullConstraintsRequest");
+                       Object request = 
requestClz.getDeclaredConstructor(String.class, String.class, String.class)
+                                       .newInstance(hiveDefaultCatalog, 
dbName, tableName);
+                       method = 
client.getClass().getDeclaredMethod("getNotNullConstraints", requestClz);
 
 Review comment:
   Added this util method but we actually cannot get base class from obj, and 
parameter classes from args. Because the target method can be a static method 
in which case obj is null, and args can be sub-classes of parameters declared 
in method signature.

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