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

Fix HoS when scratch_dir is using remote HDFS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      HoS would fail when scratch dir is using remote HDFS:

        public static URI uploadToHDFS(URI source, HiveConf conf) throws IOException {
          Path localFile = new Path(source.getPath());
          Path remoteFile = new Path(SessionState.get().getSparkSession().getHDFSSessionDir(),
              getFileName(source));
      -    FileSystem fileSystem = FileSystem.get(conf);
      +    FileSystem fileSystem = remoteFile.getFileSystem(conf);
          // Overwrite if the remote file already exists. Whether the file can be added
          // on executor is up to spark, i.e. spark.files.overwrite
          fileSystem.copyFromLocalFile(false, true, localFile, remoteFile);
          Path fullPath = fileSystem.getFileStatus(remoteFile).getPath();
      

      Attachments

        Issue Links

          Activity

            People

              dapengsun Dapeng Sun
              dapengsun Dapeng Sun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: