morningman commented on code in PR #60018:
URL: https://github.com/apache/doris/pull/60018#discussion_r2706723250


##########
fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java:
##########
@@ -168,7 +169,14 @@ public void bindDataSink(Optional<InsertCommandContext> 
insertCtx)
 
     private String createTempPath(String location) {
         String user = ConnectContext.get().getCurrentUserIdentity().getUser();
-        return LocationPath.getTempWritePath(location, "/tmp/.doris_staging/" 
+ user);
+        String defaultStagingBaseDir = ".doris_staging";
+        String stagingBaseDir = targetTable.getCatalog().getCatalogProperty()

Review Comment:
   Can user specify this stage dir arbitrarily? Is it safe?
   What if user specify dir like `/etc` or `/`?



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java:
##########
@@ -1620,6 +1635,117 @@ public void shutdownExecutorService() {
         }
     }
 
+    private static boolean isSubDirectory(String parent, String child) {

Review Comment:
   Add unit test for these static methods.
   This check is very important, we need to cover every corner case, otherwise, 
we may delete data file accidentally



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to