2014-04-02 76 views
0

我使用HCatalog的WebHCat API運行豬的工作,如記錄在這裏:WebHCat&Pig - 如何將參數文件傳遞給作業?

https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference+Pig

我運行一個簡單的工作沒有問題,但我想附加參數文件提供給工作,如可以使用pig命令行參數:--param_file

我想這是有可能通過arg請求的參數,所以我想多東西,比如傳:

'arg': '-param_file /path/to/param.file' 

或:

'arg': {'param_file': '/path/to/param.file'} 

無似乎工作,並錯誤棧別不多說了。 我很想知道這是否可能,如果是的話,如何正確實現這一點。

非常感謝

回答

0

正確用法:

'arg': ['-param_file', '/path/to/param.file'] 

說明: 通過傳遞值在精氨酸,

'arg': {'-param_file': '/path/to/param.file'} 

webhcat產生用於命令提示 「-param_file」。 豬引發以下錯誤

ERROR org.apache.pig.Main - ERROR 2999: Unexpected internal error. Can not create a Path from a null string 

使用逗號代替冒號操作者傳遞文件路徑作爲第二個參數。 webhcat會產生 「-param_file」 「/path/to/param.file」

P.S:我使用Python的請求庫,使REST調用

相關問題