Sqoop: java.lang.RuntimeException: Table test_table does not have primary key. Please use --split-by argument if applicable

This is for Hadoop eco system like HDFS, Map reduce, Hive, Hbase, Pig, sqoop,sqoop2, Avro, solr, hcatalog, impala, Oozie, Zoo Keeper and Hadoop distribution like Cloudera, Hortonwork etc.
ramverma
Posts: 435
Joined: Sat Aug 23, 2014 5:34 pm
Contact:

Sqoop: java.lang.RuntimeException: Table test_table does not have primary key. Please use --split-by argument if applicable

Postby ramverma » Thu Sep 17, 2015 8:28 pm

I am getting below error in sqoop while doing import from Teradata.

root] sqoop import --connect jdbc:teradata://localhost/DATABASE=DL_TESTlogmech=ldap
--username test --password test --table test_table --num-mappers 3 --escaped-by '\\' --fields-terminated-by ',' --lines-terminated-by '\n' --split-by colmn1

15/09/17 14:48:34 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Table test_table does not have primary key. Please use --split-by argument if applicable
java.lang.RuntimeException: Table test_table does not have primary key. Please use --split-by argument if applicable
at com.cloudera.connector.teradata.TeradataManager.getPrimaryKey(TeradataManager.java:175)
at org.apache.sqoop.manager.SqlManager.getSplitColumn(SqlManager.java:597)
at com.cloudera.connector.teradata.TeradataManager.importTable(TeradataManager.java:273)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
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)


Return to “Hadoop and Big Data”

Who is online

Users browsing this forum: No registered users and 5 guests