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

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

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

  1. Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);

代码示例来源:origin: apache/drill

  1. private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
  2. throws HiveException, IOException {
  3. // if source exists, rename. Otherwise, create a empty directory
  4. if (fs.exists(sourcePath)) {
  5. Path deletePath = null;
  6. // If it multiple level of folder are there fs.rename is failing so first
  7. // create the targetpath.getParent() if it not exist
  8. if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
  9. deletePath = createTargetPath(targetPath, fs);
  10. }
  11. Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
  12. if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
  13. try {
  14. if (deletePath != null) {
  15. fs.delete(deletePath, true);
  16. }
  17. } catch (IOException e) {
  18. LOG.info("Unable to delete the path created for facilitating rename"
  19. + deletePath);
  20. }
  21. throw new HiveException("Unable to rename: " + sourcePath
  22. + " to: " + targetPath);
  23. }
  24. } else if (!fs.mkdirs(targetPath)) {
  25. throw new HiveException("Unable to make directory: " + targetPath);
  26. }
  27. }

相关文章

Hive类方法