Copilot commented on code in PR #61792:
URL: https://github.com/apache/doris/pull/61792#discussion_r2998635291


##########
docker/thirdparties/run-thirdparties-docker.sh:
##########
@@ -359,7 +362,17 @@ ensure_juicefs_hadoop_jar_for_hive() {
     fi
 
     mkdir -p "${auxlib_dir}"
-    cp -f "${source_jar}" "${auxlib_dir}/"
+    target_jar="${auxlib_dir}/$(basename "${source_jar}")"
+    source_realpath=$(realpath "${source_jar}")
+    if [[ -e "${target_jar}" ]]; then
+        target_realpath=$(realpath "${target_jar}")
+        if [[ "${source_realpath}" == "${target_realpath}" ]]; then

Review Comment:
   This introduces a new hard dependency on the external `realpath` command in 
the Hive path. On environments where `realpath` isn’t available, 
`ensure_juicefs_hadoop_jar_for_hive` will fail even though the copy could 
succeed. Since the goal is just “same file” detection, consider using Bash’s 
file test `[[ "$source_jar" -ef "$target_jar" ]]` (same inode) to avoid 
external commands and handle symlink/hardlink cases more robustly.



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