You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/22 17:17:34 UTC

[GitHub] [iceberg] jfz commented on a diff in pull request #5282: AWS: Fix #2796 - avoid S3 error of "Resetting to invalid mark" by re-creating input stream on retries

jfz commented on code in PR #5282:
URL: https://github.com/apache/iceberg/pull/5282#discussion_r927851995


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputStream.java:
##########
@@ -389,7 +391,9 @@ private void completeUploads() {
       S3RequestUtil.configureEncryption(awsProperties, requestBuilder);
       S3RequestUtil.configurePermission(awsProperties, requestBuilder);
 
-      s3.putObject(requestBuilder.build(), RequestBody.fromInputStream(contentStream, contentLength));
+      s3.putObject(
+          requestBuilder.build(),
+          RequestBody.fromContentProvider(contentProvider, contentLength, Mimetype.MIMETYPE_OCTET_STREAM));

Review Comment:
   The input stream here is a composition from multiple `stagingFiles`, is size of `stagingFiles` always 1 when it's not multipart? It's possible if that's the case, but I think the current way is a bit more elegant and future proof without that assumption.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org