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

remove useless uri.getScheme() from EximUtil

    XMLWordPrintableJSON

Details

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

    Description

      EximUtil.java
      static URI getValidatedURI(HiveConf conf, String dcPath) throws SemanticException {
          try {
            boolean testMode = conf.getBoolVar(HiveConf.ConfVars.HIVETESTMODE);
            URI uri = new Path(dcPath).toUri();
            String scheme = uri.getScheme();
            String authority = uri.getAuthority();
            String path = uri.getPath();
            FileSystem fs = FileSystem.get(uri, conf);
      
            LOG.info("Path before norm :" + path);
            // generate absolute path relative to home directory
            if (!path.startsWith("/")) {
              if (testMode) {
                path = (new Path(System.getProperty("test.tmp.dir"), path)).toUri().getPath();
              } else {
                path =
                    (new Path(new Path("/user/" + System.getProperty("user.name")), path)).toUri()
                        .getPath();
              }
            }
      
            // Get scheme from FileSystem
            scheme = fs.getScheme();
        ...
      }
      

      We found that String scheme = uri.getScheme(); is useless, we can remove it.

      Attachments

        1. HIVE-16920.patch
          1 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: