Skip to content

Commit f5d0c52

Browse files
committed
Merge branch '1.8_release_4.0.x' into temp_1.10_4.0.x_merge
# Conflicts: # flinkx-metadata/flinkx-metadata-reader/src/main/java/com/dtstack/flinkx/metadata/inputformat/BaseMetadataInputFormat.java
2 parents c1111e6 + 6b44bbd commit f5d0c52

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

@@ -82,11 +83,14 @@ protected void openInternal(InputSplit inputSplit) throws IOException {
8283
LOG.info("current database = {}, tableSize = {}, tableList = {}",currentDb.get(), tableList.size(), tableList);
8384
tableIterator.set(tableList.iterator());
8485
init();
85-
} catch (SQLException | ClassNotFoundException e) {
86-
String message = String.format("query table list failed, dbUrl = %s, username = %s, inputSplit = %s, e = %s", dbUrl, username, inputSplit, ExceptionUtil.getErrorMessage(e));
87-
LOG.error(message);
88-
throw new IOException(message, e);
86+
} catch (ClassNotFoundException e) {
87+
LOG.error("could not find suitable driver, e={}", ExceptionUtil.getErrorMessage(e));
88+
throw new IOException(e);
89+
} catch (SQLException e){
90+
LOG.error("获取table列表异常, dbUrl = {}, username = {}, inputSplit = {}, e = {}", dbUrl, username, inputSplit, ExceptionUtil.getErrorMessage(e));
91+
tableList = new LinkedList<>();
8992
}
93+
tableIterator.set(tableList.iterator());
9094
}
9195

9296
/**

0 commit comments

Comments
 (0)