本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.clearDestForSubDirSrc()
方法的一些代码示例,展示了Hive.clearDestForSubDirSrc()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.clearDestForSubDirSrc()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:clearDestForSubDirSrc
暂无
代码示例来源:origin: apache/hive
Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
代码示例来源:origin: apache/drill
private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
throws HiveException, IOException {
// if source exists, rename. Otherwise, create a empty directory
if (fs.exists(sourcePath)) {
Path deletePath = null;
// If it multiple level of folder are there fs.rename is failing so first
// create the targetpath.getParent() if it not exist
if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
deletePath = createTargetPath(targetPath, fs);
}
Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
try {
if (deletePath != null) {
fs.delete(deletePath, true);
}
} catch (IOException e) {
LOG.info("Unable to delete the path created for facilitating rename"
+ deletePath);
}
throw new HiveException("Unable to rename: " + sourcePath
+ " to: " + targetPath);
}
} else if (!fs.mkdirs(targetPath)) {
throw new HiveException("Unable to make directory: " + targetPath);
}
}
内容来源于网络,如有侵权,请联系作者删除!