Skip to content

Commit 3871abf

Browse files
committed
modify impala sink throw exception
1 parent 28ca214 commit 3871abf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

impala/impala-sink/src/main/java/com/dtstack/flink/sql/sink/impala/ImpalaOutputFormat.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import java.io.IOException;
99
import java.security.PrivilegedAction;
10+
import java.security.PrivilegedExceptionAction;
1011
import java.util.List;
1112

1213
import static org.apache.flink.util.Preconditions.checkNotNull;
@@ -55,17 +56,17 @@ public ImpalaOutputFormat(
5556
public void open(int taskNumber, int numTasks) throws IOException {
5657
if (authMech == 1) {
5758
UserGroupInformation ugi = KrbUtils.getUgi(principal, keytabPath, krb5confPath);
58-
ugi.doAs(new PrivilegedAction<Object>() {
59-
@Override
60-
public Object run() {
61-
try {
59+
try {
60+
ugi.doAs(new PrivilegedExceptionAction<Void>() {
61+
@Override
62+
public Void run() throws IOException {
6263
openJdbc();
63-
} catch (IOException e) {
64-
e.printStackTrace();
64+
return null;
6565
}
66-
return null;
67-
}
68-
});
66+
});
67+
} catch (InterruptedException e) {
68+
e.printStackTrace();
69+
}
6970
} else {
7071
super.open(taskNumber, numTasks);
7172
}

0 commit comments

Comments
 (0)