Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4939

QueryParserUtils.setHdfsServers(QueryParserUtils.java:104) should not be called for non-dfs methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.17.0
    • impl
    • None
    • Reviewed

    Description

      A = load 'hbase://query/SELECT ID,NAME,DATE FROM HIRES WHERE DATE > TO_DATE('1990-12-21 05:55:00.000');
      STORE A into 'output';
      

      The above script throws an exception because it treats the location as an fs path and tries to convert it to a URI after splitting it based on comma.

      The code that tries to the same is

       String buildLoadOp(SourceLocation loc, String alias, String filename, FuncSpec funcSpec, LogicalSchema schema)
          throws ParserValidationException {
              String absolutePath;
              LoadFunc loFunc;
              try {
                  // Load LoadFunc class from default properties if funcSpec is null. Fallback on PigStorage if LoadFunc is not specified in properties.
                  funcSpec = funcSpec == null ? new FuncSpec(pigContext.getProperties().getProperty(PigConfiguration.PIG_DEFAULT_LOAD_FUNC, PigStorage.class.getName())) : funcSpec;
                  loFunc = (LoadFunc)PigContext.instantiateFuncFromSpec(funcSpec);
                  ......
                  .......
                  if (absolutePath == null) {
                      absolutePath = loFunc.relativeToAbsolutePath( filename, QueryParserUtils.getCurrentDir( pigContext ) );
      
                      if (absolutePath!=null) {
                          QueryParserUtils.setHdfsServers( absolutePath, pigContext );
                      }
               .....  
             }
      

      We should not be calling QueryParserUtils.setHdfsServers(QueryParserUtils.java:104) should not be called for non-dfs methods

      Attachments

        1. PIG-4939.patch
          5 kB
          Ádám Szita
        2. PIG-4939-PHOENIX.patch
          1 kB
          Ádám Szita
        3. PIG-4939.1.patch
          5 kB
          Ádám Szita
        4. PIG-4939.2.patch
          6 kB
          Ádám Szita

        Issue Links

          Activity

            People

              szita Ádám Szita
              siddhimehta Siddhi Mehta
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: