ayushtkn commented on a change in pull request #2793:
URL: https://github.com/apache/hive/pull/2793#discussion_r750212175
##########
File path: common/src/java/org/apache/hadoop/hive/common/FileUtils.java
##########
@@ -662,10 +663,27 @@ static boolean copy(FileSystem srcFS, Path src,
// wherein if distcp fails, there is good reason to not plod along with
a trivial
// implementation, and fail instead.
copied = FileUtil.copy(srcFS, src, dstFS, dst, deleteSource, overwrite,
conf);
+ if (copied && !deleteSource
+ && Utils.checkFileSystemXAttrSupport(srcFS) &&
Utils.checkFileSystemXAttrSupport(dstFS)) {
+ copyXAttrs(srcFS, srcFS.getFileStatus(src), dstFS, dst);
+ }
}
return copied;
}
+ public static void copyXAttrs(FileSystem srcFS, FileStatus srcStatus,
FileSystem dstFS, Path dst) throws IOException {
+ Path src = srcStatus.getPath();
+ if (srcStatus.isDirectory()) {
+ for(FileStatus content: srcFS.listStatus(src)) {
Review comment:
Use `listStatusIterator`
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##########
@@ -988,6 +990,52 @@ public void
testReadOperationsNotCapturedInNotificationLog() throws Throwable {
}
}
+ @Test
+ public void testXAttrsPreserved() throws Throwable {
+ String tbName = "dummyTable";
+ primary.run("use " + primaryDbName)
+ .run("CREATE TABLE " + tbName + "(a int) STORED AS TEXTFILE")
Review comment:
Can have a transactional table as well, and have Xattrs on the the
different levels of the directory structure & confirms it gets preserved, say
at delta folder and so on...
--
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]