org.apache.hadoop.hive.ql.metadata.Hive.clearDestForSubDirSrc()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(201)

本文整理了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

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);
 }
}

相关文章

微信公众号

最新文章

更多

Hive类方法