Skip to content

Commit

Permalink
Merge pull request databendlabs#213 from datafuselabs/fix/uploadstrea…
Browse files Browse the repository at this point in the history
…m-exception

fix: uploadStream exception
  • Loading branch information
hantmac authored May 4, 2024
2 parents ee9b9eb + cd40294 commit f421590
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,13 @@ public void uploadStream(String stageName, String destPrefix, InputStream inputS
logger.info("upload cost time: " + (uploadEndTime - uploadStartTime) / 1000000.0 + "ms");
}
}
} catch (JsonProcessingException e) {
} catch (RuntimeException e) {
System.out.println(e.getMessage());
// For datax batch insert test, do not throw exception
throw new SQLException(e);
} catch (IOException e) {
logger.warning("failed to upload input stream, file size is:" + fileSize / 1024.0 + e.getMessage());
throw new SQLException(e);
}
}

Expand All @@ -721,7 +722,7 @@ public InputStream downloadStream(String stageName, String sourceFileName, boole
Headers h = ctx.getHeaders();
String presignUrl = ctx.getUrl();
return cli.presignDownloadStream(h, presignUrl);
} catch (JsonProcessingException e) {
} catch (RuntimeException e) {
throw new SQLException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void dropStageIfExists(DatabendConnection connection, String stage
}

public static PresignContext getPresignContext(DatabendConnection connection, PresignMethod method, String stageName, String fileName)
throws SQLException, JsonProcessingException {
throws SQLException {
requireNonNull(connection, "connection is null");
requireNonNull(method, "method is null");
Statement statement = connection.createStatement();
Expand Down

0 comments on commit f421590

Please sign in to comment.