sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam liu <liuqiyun2...@gmail.com>
Subject Re: An issue of importing a table from DB2 Luw 97 database using Sqoop 1.4.1
Date Wed, 23 May 2012 07:44:49 GMT
But in my command, there is no specific sql and just use sqoop's syntax as
below:
./sqoop import --connect jdbc:db2://9.1111.146.111:50000/SAMPLE --table
DB2ADMIN.DB2TEST_TBL003 --username sam --password db2adminpassword -m 1

By the way, I can successfully executed similar import command on Oracle 11
database server.



2012/5/23 Steve Souza <steve@liquilight.com>

>
> According to google  the error message means you have invalid characters
> in your sql....
>
> When sql statements contain special characters, for example,
> line breaks, carriage returns, line feeds, receive the following
> error by using the Universal Driver:
> DB2 SQL error: SQLCODE: -7, SQLSTATE: 42601, SQLERRMC:
> This is a simple sample of such a SQL statement:
> static final String sqlQuery = "SELECT empno, firstnme,
> lastname, salary \n"
> + "  FROM employee WHERE workdept='A00'";
>
>
>
> On Wed, May 23, 2012 at 7:53 AM, sam liu <liuqiyun2011@gmail.com> wrote:
>
>> Hi,
>>
>> I have an issue of importing a table from DB2 Luw 97 database using
>> Sqoop. Below is the logs. Could any one help me? Thanks in advance very
>> much!
>>
>>
>> [root@localhost bin]# ./sqoop import --connect jdbc:db2://9.1111.146.111:
>> 50000/SAMPLE --table DB2ADMIN.DB2TEST_TBL003 --username sam --password
>> db2adminpassword -m 1
>> Warning: /usr/lib/hbase does not exist! HBase imports will fail.
>> Please set $HBASE_HOME to the root of your HBase installation.
>> 12/05/22 23:35:56 WARN tool.BaseSqoopTool: Setting your password on the
>> command-line is insecure. Consider using -P instead.
>> 12/05/22 23:35:56 INFO manager.SqlManager: Using default fetchSize of 1000
>> 12/05/22 23:35:56 INFO tool.CodeGenTool: Beginning code generation
>> 12/05/22 23:35:59 INFO manager.SqlManager: Executing SQL statement:
>> SELECT t.* FROM DB2ADMIN.DB2TEST_TBL003 AS t WHERE 1=0
>> 12/05/22 23:35:59 INFO manager.SqlManager: Executing SQL statement:
>> SELECT t.* FROM DB2ADMIN.DB2TEST_TBL003 AS t WHERE 1=0
>> 12/05/22 23:35:59 INFO orm.CompilationManager: HADOOP_HOME is
>> /opt/hadoop-0.20.2/bin/..
>> 12/05/22 23:35:59 INFO orm.CompilationManager: Found hadoop core jar at:
>> /opt/hadoop-0.20.2/bin/../hadoop-0.20.2-core.jar
>> Note:
>> /tmp/sqoop-root/compile/56c3a2cc91c28bad8d66ca7b80e997d0/DB2ADMIN_DB2TEST_TBL003.java
>> uses or overrides a deprecated API.
>> Note: Recompile with -Xlint:deprecation for details.
>> 12/05/22 23:35:59 INFO orm.CompilationManager: Writing jar file:
>> /tmp/sqoop-root/compile/56c3a2cc91c28bad8d66ca7b80e997d0/DB2ADMIN.DB2TEST_TBL003.jar
>> 12/05/22 23:35:59 INFO mapreduce.ImportJobBase: Beginning import of
>> DB2ADMIN.DB2TEST_TBL003
>> 12/05/22 23:36:55 INFO manager.SqlManager: Executing SQL statement:
>> SELECT t.* FROM DB2ADMIN.DB2TEST_TBL003 AS t WHERE 1=0
>> 12/05/22 23:37:00 INFO mapred.JobClient: Running job:
>> job_201205222335_0001
>> 12/05/22 23:37:01 INFO mapred.JobClient:  map 0% reduce 0%
>> 12/05/22 23:37:16 INFO mapred.JobClient: Task Id :
>> attempt_201205222335_0001_m_000000_0, Status : FAILED
>> java.io.IOException: SQLException in nextKeyValue
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:265)
>>         at
>> org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423)
>>         at
>> org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
>>         at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
>>         at
>> org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:183)
>>         at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
>>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
>>         at org.apache.hadoop.mapred.Child.main(Child.java:170)
>> Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error:
>> SQLCODE=-104, SQLSTATE=42601, SQLERRMC=.;T_TBL003 AS DB2ADMIN;,,
>> DRIVER=3.62.56
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:676)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:60)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:127)
>>         at com.ibm.db2.jcc.am.jn.c(jn.java:2614)
>>         at com.ibm.db2.jcc.am.jn.d(jn.java:2602)
>>         at com.ibm.db2.jcc.am.jn.a(jn.java:2094)
>>         at com.ibm.db2.jcc.am.kn.a(kn.java:6720)
>>         at com.ibm.db2.jcc.t4.cb.g(cb.java:141)
>>         at com.ibm.db2.jcc.t4.cb.a(cb.java:41)
>>         at com.ibm.db2.jcc.t4.q.a(q.java:32)
>>         at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
>>         at com.ibm.db2.jcc.am.jn.gb(jn.java:2064)
>>         at com.ibm.db2.jcc.am.kn.pc(kn.java:3214)
>>         at com.ibm.db2.jcc.am.kn.b(kn.java:3999)
>>         at com.ibm.db2.jcc.am.kn.cc(kn.java:709)
>>         at com.ibm.db2.jcc.am.kn.executeQuery(kn.java:683)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:236)
>>         ... 7 more
>>
>> 12/05/22 23:37:22 INFO mapred.JobClient: Task Id :
>> attempt_201205222335_0001_m_000000_1, Status : FAILED
>> java.io.IOException: SQLException in nextKeyValue
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:265)
>>         at
>> org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423)
>>         at
>> org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
>>         at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
>>         at
>> org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:183)
>>         at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
>>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
>>         at org.apache.hadoop.mapred.Child.main(Child.java:170)
>> Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error:
>> SQLCODE=-104, SQLSTATE=42601, SQLERRMC=.;T_TBL003 AS DB2ADMIN;,,
>> DRIVER=3.62.56
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:676)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:60)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:127)
>>         at com.ibm.db2.jcc.am.jn.c(jn.java:2614)
>>         at com.ibm.db2.jcc.am.jn.d(jn.java:2602)
>>         at com.ibm.db2.jcc.am.jn.a(jn.java:2094)
>>         at com.ibm.db2.jcc.am.kn.a(kn.java:6720)
>>         at com.ibm.db2.jcc.t4.cb.g(cb.java:141)
>>         at com.ibm.db2.jcc.t4.cb.a(cb.java:41)
>>         at com.ibm.db2.jcc.t4.q.a(q.java:32)
>>         at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
>>         at com.ibm.db2.jcc.am.jn.gb(jn.java:2064)
>>         at com.ibm.db2.jcc.am.kn.pc(kn.java:3214)
>>         at com.ibm.db2.jcc.am.kn.b(kn.java:3999)
>>         at com.ibm.db2.jcc.am.kn.cc(kn.java:709)
>>         at com.ibm.db2.jcc.am.kn.executeQuery(kn.java:683)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:236)
>>         ... 7 more
>>
>> 12/05/22 23:37:29 INFO mapred.JobClient: Task Id :
>> attempt_201205222335_0001_m_000000_2, Status : FAILED
>> java.io.IOException: SQLException in nextKeyValue
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:265)
>>         at
>> org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423)
>>         at
>> org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
>>         at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
>>         at
>> org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:183)
>>         at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
>>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
>>         at org.apache.hadoop.mapred.Child.main(Child.java:170)
>> Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error:
>> SQLCODE=-104, SQLSTATE=42601, SQLERRMC=.;T_TBL003 AS DB2ADMIN;,,
>> DRIVER=3.62.56
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:676)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:60)
>>         at com.ibm.db2.jcc.am.fd.a(fd.java:127)
>>         at com.ibm.db2.jcc.am.jn.c(jn.java:2614)
>>         at com.ibm.db2.jcc.am.jn.d(jn.java:2602)
>>         at com.ibm.db2.jcc.am.jn.a(jn.java:2094)
>>         at com.ibm.db2.jcc.am.kn.a(kn.java:6720)
>>         at com.ibm.db2.jcc.t4.cb.g(cb.java:141)
>>         at com.ibm.db2.jcc.t4.cb.a(cb.java:41)
>>         at com.ibm.db2.jcc.t4.q.a(q.java:32)
>>         at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
>>         at com.ibm.db2.jcc.am.jn.gb(jn.java:2064)
>>         at com.ibm.db2.jcc.am.kn.pc(kn.java:3214)
>>         at com.ibm.db2.jcc.am.kn.b(kn.java:3999)
>>         at com.ibm.db2.jcc.am.kn.cc(kn.java:709)
>>         at com.ibm.db2.jcc.am.kn.executeQuery(kn.java:683)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)
>>         at
>> org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:236)
>>         ... 7 more
>>
>> 12/05/22 23:37:38 INFO mapred.JobClient: Job complete:
>> job_201205222335_0001
>> 12/05/22 23:37:38 INFO mapred.JobClient: Counters: 2
>> 12/05/22 23:37:38 INFO mapred.JobClient:   Job Counters
>> 12/05/22 23:37:38 INFO mapred.JobClient:     Launched map tasks=4
>> 12/05/22 23:37:38 INFO mapred.JobClient:     Failed map tasks=1
>> 12/05/22 23:37:38 INFO mapreduce.ImportJobBase: Transferred 0 bytes in
>> 43.7817 seconds (0 bytes/sec)
>> 12/05/22 23:37:39 INFO mapreduce.ImportJobBase: Retrieved 0 records.
>> 12/05/22 23:37:39 ERROR tool.ImportTool: Error during import: Import job
>> failed!
>> [root@localhost bin]#
>>
>>
>>
>>
>> Regards,
>>
>> Sam Liu
>>
>
>

Mime
View raw message