[ 
https://issues.apache.org/jira/browse/HIVE-22537?focusedWorklogId=349633&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-349633
 ]

ASF GitHub Bot logged work on HIVE-22537:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Nov/19 08:53
            Start Date: 26/Nov/19 08:53
    Worklog Time Spent: 10m 
      Work Description: pvary commented on pull request #854: HIVE-22537: 
getAcidState() not saving directory causes multiple files…
URL: https://github.com/apache/hive/pull/854#discussion_r350606330
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
 ##########
 @@ -1683,15 +1705,20 @@ else if (writeIdList.isWriteIdRangeValid(
     }
   }
   
-  private static void getChildState(Path candidateDirectory, 
List<HdfsDirSnapshot> dirSnapshots, ValidWriteIdList writeIdList,
+  private static void getChildState(Path candidateDirectory, Map<Path, 
HdfsDirSnapshot> dirSnapshots, ValidWriteIdList writeIdList,
       List<ParsedDelta> working, List<Path> originalDirectories, 
List<HdfsFileStatusWithId> original,
       List<Path> obsolete, TxnBase bestBase, boolean ignoreEmptyFiles, 
List<Path> aborted,
       Map<String, String> tblproperties, FileSystem fs, ValidTxnList 
validTxnList) throws IOException {
-    for (HdfsDirSnapshot dirSnapshot : dirSnapshots) {
+    for (HdfsDirSnapshot dirSnapshot : dirSnapshots.values()) {
       FileStatus fStat = dirSnapshot.getFileStatus();
       Path dirPath = dirSnapshot.getPath();
       String dirName = dirPath.getName();
-      if (dirName.startsWith(BASE_PREFIX)) {
+      if (dirPath.equals(candidateDirectory)) {
+        for (FileStatus fileStatus: dirSnapshot.getFiles())
+        if (!ignoreEmptyFiles || fileStatus.getLen() != 0) {
 
 Review comment:
   Nit: formatting - please use {} for for loops, like
   for () {
   if {}
   }
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 349633)
    Time Spent: 20m  (was: 10m)

> getAcidState() not saving directory snapshot causes multiple calls to S3 api
> ----------------------------------------------------------------------------
>
>                 Key: HIVE-22537
>                 URL: https://issues.apache.org/jira/browse/HIVE-22537
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: Mustafa Iman
>            Assignee: Mustafa Iman
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22537.2.patch, HIVE-22537.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Fix for HIVE-21225 is not enabled in query coordinator codepath. The last 
> argument (generateDirSnapshots) for getAcidState() is set to false when 
> invoked by callInternal(). Also, snapshot is not used for file exists calls.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to