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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]