Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Import-all-tables fail while importing tables from Sqoop to Hive in Parquet format

Highlighted

Import-all-tables fail while importing tables from Sqoop to Hive in Parquet format

New Contributor

Hi All,

I tried to import all tables from 'serviceorderdb' in HDP sandbox MySQL DB to Hive 'serviceorderdb' DB in Parquet format.

sqoop import-all-tables  --connect jdbc:mysql://sandbox.test/serviceorderdb  --username=test --password=test --driver com.mysql.jdbc.Driver --as-parquetfile  --create-hive-table --hive-import 
--hive-database serviceorderdb --compression-codec=snappy

Following error is coming

17/04/08 17:45:54 INFO tool.CodeGenTool: Beginning code generation17/04/08 17:45:54 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerExceptionjava.lang.NullPointerException   at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:97)   at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)   at org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:111)   at org.apache.sqoop.Sqoop.run(Sqoop.java:148)   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)   at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184)   at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226)   at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235)   at org.apache.sqoop.Sqoop.main(Sqoop.java:244)

But it import works fine when --as-parquetfile is replaced with --as-textfile. Please suggest what is the right way to import all tables in Parquet format in Hive.

Don't have an account?
Coming from Hortonworks? Activate your account here