lirui-apache commented on a change in pull request #15653:
URL: https://github.com/apache/flink/pull/15653#discussion_r645466486



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/util/JobConfUtils.java
##########
@@ -40,4 +44,24 @@ public static String getDefaultPartitionName(JobConf 
jobConf) {
                 HiveConf.ConfVars.DEFAULTPARTITIONNAME.varname,
                 HiveConf.ConfVars.DEFAULTPARTITIONNAME.defaultStrVal);
     }
+
+    private static void addCredentialsIntoJobConf(JobConf jobConf) {
+        try {
+            Credentials currentUserCreds =
+                    HadoopInputFormatCommonBase.getCredentialsFromUGI(
+                            UserGroupInformation.getCurrentUser());
+            if (currentUserCreds != null) {
+                jobConf.getCredentials().mergeAll(currentUserCreds);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(

Review comment:
       I don't think we should error out if 
`HadoopInputFormatCommonBase.getCredentialsFromUGI` fails, right?




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


Reply via email to