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

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

                Author: ASF GitHub Bot
            Created on: 10/Feb/21 17:04
            Start Date: 10/Feb/21 17:04
    Worklog Time Spent: 10m 
      Work Description: pvargacl commented on a change in pull request #1915:
URL: https://github.com/apache/hive/pull/1915#discussion_r573909577



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
##########
@@ -1470,16 +1470,15 @@ private static ValidTxnList 
getValidTxnList(Configuration conf) {
     return dirToSnapshots;
   }
 
-  private static boolean isChildOfDelta(Path childDir, Path rootPath) {
+  public static boolean isChildOfDelta(Path childDir, Path rootPath) {
     if (childDir.toUri().toString().length() <= 
rootPath.toUri().toString().length()) {
       return false;
     }
     // We do not want to look outside the original directory
     String fullName = 
childDir.toUri().toString().substring(rootPath.toUri().toString().length() + 1);
     String dirName = childDir.getName();
-    return (fullName.startsWith(BASE_PREFIX) && 
!dirName.startsWith(BASE_PREFIX)) ||
-        (fullName.startsWith(DELTA_PREFIX) && 
!dirName.startsWith(DELTA_PREFIX)) ||
-        (fullName.startsWith(DELETE_DELTA_PREFIX) && 
!dirName.startsWith(DELETE_DELTA_PREFIX));
+    return (!dirName.startsWith(BASE_PREFIX)) && 
!dirName.startsWith(DELTA_PREFIX) && !dirName.startsWith(DELETE_DELTA_PREFIX)
+          && (fullName.contains(BASE_PREFIX) || 
fullName.contains(DELTA_PREFIX) || fullName.contains(DELETE_DELTA_PREFIX));

Review comment:
       Yes. Previously it was working only for rootpath like 
delta_00001/subdir/, now it works for table/partition=1/delta_00001/subdir
   The reordering was needed because fullName.contains(delta_prefix) && 
!dirname.startWith(delta_prefix) is true for delete_delta_000001, and it would 
yield wrong result




----------------------------------------------------------------
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: 550798)
    Time Spent: 1h 40m  (was: 1.5h)

> Collect dynamic partition info in FileSink for direct insert and reuse it in 
> Movetask
> -------------------------------------------------------------------------------------
>
>                 Key: HIVE-24682
>                 URL: https://issues.apache.org/jira/browse/HIVE-24682
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Peter Varga
>            Assignee: Peter Varga
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> The dynamic partition infos can be collected from the manifest files, no need 
> to do a costly file listing later



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

Reply via email to