JingsongLi commented on code in PR #8228:
URL: https://github.com/apache/paimon/pull/8228#discussion_r3419620558
##########
paimon-filesystems/paimon-oss-impl/src/main/java/org/apache/paimon/oss/OSSFileIO.java:
##########
@@ -180,6 +184,34 @@ protected AliyunOSSFileSystem
createFileSystem(org.apache.hadoop.fs.Path path) {
}
}
+ @Override
+ public boolean tryToWriteAtomic(Path path, String content) throws
IOException {
+ URI uri = path.toUri();
+ String bucket = uri.getHost();
+ String objectKey = uri.getPath().substring(1);
+ byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
+
+ ObjectMetadata metadata = new ObjectMetadata();
+ metadata.setContentLength(bytes.length);
+ metadata.setHeader("x-oss-forbid-overwrite", "true");
Review Comment:
The direct SDK upload no longer carries
`fs.oss.server-side-encryption-algorithm` into `ObjectMetadata`. The Hadoop OSS
write path that this replaces sets `ObjectMetadata#setServerSideEncryption`
before `putObject`; with catalogs configured for OSS SSE this can either
violate bucket policies that require encrypted uploads or create unencrypted
metadata/version files. Could we set the same SSE header from the configured
Hadoop options/store before calling `putObject`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]