Skip to content

Commit 75cb3c3

Browse files
committed
[opt] 优化impala异常处理
1 parent b705be1 commit 75cb3c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public void close() throws IOException {
473473
updateStatement.close();
474474
}
475475
} catch (SQLException e) {
476-
throw new RemoteException("impala connection close failed!", e);
476+
throw new RuntimeException("impala connection close failed!", e);
477477
} finally {
478478
connection = null;
479479
statement = null;
@@ -531,7 +531,7 @@ private void executeBatchSql(Statement statement,
531531
// partition sql
532532
Set<String> keySet = rowDataMap.keySet();
533533
String finalTempSql = tempSql;
534-
keySet.forEach(key -> {
534+
for (String key : keySet) {
535535
try {
536536
String executeSql = String.copyValueOf(finalTempSql.toCharArray());
537537
ArrayList<String> valuesConditionList = rowDataMap.get(key);
@@ -544,7 +544,7 @@ private void executeBatchSql(Statement statement,
544544
} catch (SQLException sqlException) {
545545
throw new RuntimeException("execute impala SQL error! ", sqlException);
546546
}
547-
});
547+
}
548548
}
549549

550550
/**

0 commit comments

Comments
 (0)