Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16943

MoveTask should separate src FileSystem from dest FileSystem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Query Processor
    • None

    Description

      MoveTask.java
       
       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);
          }
        }
      

      Maybe sourcePath and targetPath come from defferent filesystem, we should separate them.
      I see that HIVE-11568 had done it in Hive.java

      Attachments

        1. HIVE-16943.1.patch
          3 kB
          Hui Fei

        Activity

          People

            ferhui Hui Fei
            ferhui Hui Fei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: