You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/10/26 07:05:05 UTC

[GitHub] [doris] yiguolei commented on a diff in pull request #13487: [Feature](remote)Add schema change for remote storage file

yiguolei commented on code in PR #13487:
URL: https://github.com/apache/doris/pull/13487#discussion_r1005295743


##########
be/src/io/fs/s3_file_system.cpp:
##########
@@ -226,7 +229,26 @@ Status S3FileSystem::delete_directory(const Path& path) {
 }
 
 Status S3FileSystem::link_file(const Path& src, const Path& dest) {
-    return Status::NotSupported("not support");
+    auto client = get_client();
+    CHECK_S3_CLIENT(client);
+
+    Aws::S3::Model::CopyObjectRequest request;
+    auto src_key = get_key(src);
+    auto dest_key = get_key(dest);
+    request.WithBucket(_s3_conf.bucket)
+            .WithCopySource(_s3_conf.bucket + "/" + src_key)

Review Comment:
   Pls do not use copy to implement link, it is very expensive and not assure atomic and also there will be garbage if it failed. 
   Should read and write a new rowset at application layer and then we could do gc.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org