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-unsubscr...@doris.apache.org

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


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

Reply via email to