Skip to content

Commit 6b44bbd

Browse files
committed
[fix-32672][metadata] 解决某个分片没有权限时,其他分片也无法执行的问题
1 parent 6fbb9b3 commit 6b44bbd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

flinkx-metadata/flinkx-metadata-reader/src/main/java/com/dtstack/flinkx/metadata/inputformat/BaseMetadataInputFormat.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.sql.Statement;
3434
import java.util.HashMap;
3535
import java.util.Iterator;
36+
import java.util.LinkedList;
3637
import java.util.List;
3738
import java.util.Map;
3839

@@ -81,11 +82,14 @@ protected void openInternal(InputSplit inputSplit) throws IOException {
8182
}
8283
tableIterator.set(tableList.iterator());
8384
init();
84-
} catch (SQLException | ClassNotFoundException e) {
85-
String message = String.format("获取table列表异常, dbUrl = %s, username = %s, inputSplit = %s, e = %s", dbUrl, username, inputSplit, ExceptionUtil.getErrorMessage(e));
86-
LOG.error(message);
87-
throw new IOException(message, e);
85+
} catch (ClassNotFoundException e) {
86+
LOG.error("could not find suitable driver, e={}", ExceptionUtil.getErrorMessage(e));
87+
throw new IOException(e);
88+
} catch (SQLException e){
89+
LOG.error("获取table列表异常, dbUrl = {}, username = {}, inputSplit = {}, e = {}", dbUrl, username, inputSplit, ExceptionUtil.getErrorMessage(e));
90+
tableList = new LinkedList<>();
8891
}
92+
tableIterator.set(tableList.iterator());
8993
}
9094

9195
/**

0 commit comments

Comments
 (0)