Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: CDH 5.1.0
-
Fix Version/s: None
-
Component/s: Sqoop
-
Labels:None
-
Environment:CentOS 6.4
CDH 5.1.0
Sqoop Connector 1.2.5c
Description
When I ran sqoop import using TeradataMananger and avrofile, I got the exception complaining $CONDITIONS. Obviously it is a bug in the connector because $CONDITIONS has been replaced with (1=1).
If I switch to GenericJdbcManager, everything works fine.
sqoop import --connect jdbc:teradata://server/DATABASE=mydb --username xxx --password xxx -z --compression-codec org.apache.hadoop.io.compress.SnappyCodec --query ' select userpartyid, ... eventdt from media_stream_f where EventDt='\''2014-07-01'\'' and $CONDITIONS ' --split-by UserPartyID --as-avrodatafile --target-dir=/bi/stg/media_stream_f_avro --num-mappers 5
14/07/20 11:18:40 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Query [ select userpartyid, ... eventdt from media_stream_f where EventDt='2014-07-01' and (1 = 1) ] must contain '$CONDITIONS' in WHERE clause. at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:352) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1305) at org.apache.sqoop.orm.AvroSchemaGenerator.generate(AvroSchemaGenerator.java:58) at com.cloudera.connector.teradata.imports.BaseImportJob.configureInputFormat(BaseImportJob.java:146) at com.cloudera.connector.teradata.imports.QueryImportJob.configureInputFormat(QueryImportJob.java:28) at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:239) at com.cloudera.connector.teradata.TeradataManager.importQuery(TeradataManager.java:295) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:415) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:506) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:222) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:231) at org.apache.sqoop.Sqoop.main(Sqoop.java:240)