[ 
https://issues.apache.org/jira/browse/HIVE-6546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13948523#comment-13948523
 ] 

Eric Hanson commented on HIVE-6546:
-----------------------------------

I'm not sure I understand what you mean. Can you elaborate? The placeholder is 
getting substituted or eliminated by the templeton controller job. 

If I run this simple Pig script from WebHCat:

emp = load 'wasbs://eha...@ehans7.blob.core.windows.net/data/emp_0.dat'; dump 
emp;

Then I see this in the templeton controller job configuration:

templeton.args   
cmd,/c,call,C:\\apps\\dist\\pig-0.12.0.2.0.7.0-1551/bin/pig.cmd,-D__WEBHCAT_TOKEN_FILE_LOCATION__=-execute,"emp
 = load 'wasbs://eha...@ehans7.blob.core.windows.net/data/emp_0.dat'; dump 
emp;" 

And I see this in the Pig job configuration for the job spawned by the 
templeton controller job:

pig.cmd.args    
-Dmapreduce.job.credentials.binary=/c:/hdfs/nm-local-dir/usercache/ehans/appcache/application_1395867453549_0007/container_1395867453549_0007_01_000002/container_tokens
 -execute emp = load 
'wasbs://eha...@ehans7.blob.core.windows.net/data/emp_0.dat'; dump emp; 




> WebHCat job submission for pig with -useHCatalog argument fails on Windows
> --------------------------------------------------------------------------
>
>                 Key: HIVE-6546
>                 URL: https://issues.apache.org/jira/browse/HIVE-6546
>             Project: Hive
>          Issue Type: Bug
>          Components: WebHCat
>    Affects Versions: 0.11.0, 0.12.0, 0.13.0
>         Environment: HDInsight deploying HDP 1.3:  
> c:\apps\dist\pig-0.11.0.1.3.2.0-05
> Also on Windows HDP 1.3 one-box configuration.
>            Reporter: Eric Hanson
>            Assignee: Eric Hanson
>             Fix For: 0.13.0
>
>         Attachments: HIVE-6546.01.patch, HIVE-6546.02.patch, 
> HIVE-6546.03.patch, HIVE-6546.03.patch
>
>
> On a one-box windows setup, do the following from a powershell prompt:
> cmd /c curl.exe -s `
>   -d user.name=hadoop `
>   -d arg=-useHCatalog `
>   -d execute="emp = load '/data/emp/emp_0.dat'; dump emp;" `
>   -d statusdir="/tmp/webhcat.output01" `
>   'http://localhost:50111/templeton/v1/pig' -v
> The job fails with error code 7, but it should run. 
> I traced this down to the following. In the job configuration for the 
> TempletonJobController, we have templeton.args set to
> cmd,/c,call,C:\\hadoop\\\\pig-0.11.0.1.3.0.0-0846/bin/pig.cmd,-D__WEBHCAT_TOKEN_FILE_LOCATION__="-useHCatalog",-execute,"emp
>  = load '/data/emp/emp_0.dat'; dump emp;"
> Notice the = sign before "-useHCatalog". I think this should be a comma.
> The bad string D__WEBHCAT_TOKEN_FILE_LOCATION__="-useHCatalog" gets created 
> in  org.apache.hadoop.util.GenericOptionsParser.preProcessForWindows().
> It happens at line 434:
> {code}
>       } else {
>           if (i < args.length - 1) {
>             prop += "=" + args[++i];   // RIGHT HERE! at iterations i = 37, 38
>           }
>         }
> {code}
> Bug is here:
> {code}
>       if (prop != null) {
>         if (prop.contains("=")) {  // -D__WEBHCAT_TOKEN_FILE_LOCATION__ does 
> not contain equal, so else branch is run and appends ="-useHCatalog",
>           // everything good
>         } else {
>           if (i < args.length - 1) {
>             prop += "=" + args[++i];
>           }
>         }
>         newArgs.add(prop);
>       }
> {code}
> One possible fix is to change the string constant 
> org.apache.hcatalog.templeton.tool.TempletonControllerJob.TOKEN_FILE_ARG_PLACEHOLDER
>  to have an "=" sign in it. Or, preProcessForWindows() itself could be 
> changed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to