[ 
https://issues.apache.org/jira/browse/SQOOP-1932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

xieshiju updated SQOOP-1932:
----------------------------
    Attachment: SQOOP-1932.patch

before creat a table in hive database, we should use the database firstly, 
otherwise we may get error for "Authorization failed:No privilege 'Create' 
found for outputs { database:default}. Use show grant to get more details.".

> fix authorization failuare when the --hive-table option contaion a database 
> name for import
> -------------------------------------------------------------------------------------------
>
>                 Key: SQOOP-1932
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1932
>             Project: Sqoop
>          Issue Type: Bug
>          Components: hive-integration
>    Affects Versions: 1.4.5
>         Environment: RedHat6.4 + Sqoop1.4.5 + Hive0.13 + DB2 10.5
>            Reporter: xieshiju
>             Fix For: 1.4.6
>
>         Attachments: SQOOP-1932.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> I create a new user user123 and a hive database DB1 in the hive using this 
> user user, then execute command grant all on database DB1 to user user123. 
> Following I ran a sqoop import command and want to import data from db2 table 
> to hive table:
> ./sqoop import --connect 'jdbc:db2://XXXX:50000/XIEDB' --username XXXX 
> --password XXXX --as-textfile --hive-import --hive-table DB1.hv_test --table 
> DB3BOOK --split-by ID --num-mappers 1  
> I got below error:
> 14/12/19 23:00:09 INFO hive.HiveImport: Authorization failed:No privilege 
> 'Create' found for outputs { database:default}. Use show grant to get more 
> details.
> 14/12/19 23:00:09 ERROR tool.ImportTool: Encountered IOException running 
> import job: java.io.IOException: Hive exited with status 147
>       at 
> org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:392)
>       at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:341)
>       at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:245)
>       at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:511)
>       at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601)
>       at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
>       at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
>       at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
>       at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
>       at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
>       at org.apache.sqoop.Sqoop.main(Sqoop.java:236)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to