[ 
https://issues.apache.org/jira/browse/HIVE-14864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15902460#comment-15902460
 ] 

Sahil Takiar commented on HIVE-14864:
-------------------------------------

[~spena] I worked on this some more, and think a unit test may be better suited 
for this patch rather than a qtest. There are a number of different queries 
that could invoke this method (e.g. IMPORT queries use this method too), and 
more may be added in the future. I added some integration tests that run 
against a mini HDFS cluster, and some unit tests that just rely on mocking.

[~ste...@apache.org] I agree, calling {{getContentSummary}} on S3 will be very 
slow. I've thought about filing a JIRA for the optimization you mentioned a few 
times, but never got around to doing it. Fortunately, this specific code won't 
be hit for S3, only for HDFS.

> Distcp is not called from MoveTask when src is a directory
> ----------------------------------------------------------
>
>                 Key: HIVE-14864
>                 URL: https://issues.apache.org/jira/browse/HIVE-14864
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Vihang Karajgaonkar
>            Assignee: Sahil Takiar
>         Attachments: HIVE-14864.1.patch, HIVE-14864.2.patch, 
> HIVE-14864.3.patch, HIVE-14864.4.patch, HIVE-14864.patch
>
>
> In FileUtils.java the following code does not get executed even when src 
> directory size is greater than HIVE_EXEC_COPYFILE_MAXSIZE because 
> srcFS.getFileStatus(src).getLen() returns 0 when src is a directory. We 
> should use srcFS.getContentSummary(src).getLength() instead.
> {noformat}
>     /* Run distcp if source file/dir is too big */
>     if (srcFS.getUri().getScheme().equals("hdfs") &&
>         srcFS.getFileStatus(src).getLen() > 
> conf.getLongVar(HiveConf.ConfVars.HIVE_EXEC_COPYFILE_MAXSIZE)) {
>       LOG.info("Source is " + srcFS.getFileStatus(src).getLen() + " bytes. 
> (MAX: " + conf.getLongVar(HiveConf.ConfVars.HIVE_EXEC_COPYFILE_MAXSIZE) + 
> ")");
>       LOG.info("Launch distributed copy (distcp) job.");
>       HiveConfUtil.updateJobCredentialProviders(conf);
>       copied = shims.runDistCp(src, dst, conf);
>       if (copied && deleteSource) {
>         srcFS.delete(src, true);
>       }
>     }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to