0
votes

I'm struggling to debug/understand why my sqoop command is failing from Netezza database.

I've used basically the same sqoop command for many other tables without issue. This source table in particular doesn't have any out ordinary data types, all nvarchar, nchar, integer, timestamp, etc.

Here is the specified sqoop command:

sqoop  import \
--connect jdbc:netezza://netezza-host-name:5480/nzdatabase \
--username user  \
--password  secret \
--table source_table_name  \
--as-sequencefile \
--hive-drop-import-delims \
--num-mappers 1

I've tried many things such as importing to straight text file, as avro file, without hive-drop-import-delimiters, etc.

16/03/25 18:27:48 INFO mapreduce.Job: Job job_1458490578260_0050 running in uber mode : false
16/03/25 18:27:48 INFO mapreduce.Job:  map 0% reduce 0%
16/03/25 18:28:52 INFO mapreduce.Job: Task Id : attempt_1458490578260_0050_m_000000_0, Status :
 FAILED
Error: java.lang.ArrayIndexOutOfBoundsException
        at org.netezza.sql.NzConnection.receiveDbosTuple(NzConnection.java:739)
        at org.netezza.internal.QueryExecutor.update(QueryExecutor.java:340)
        at org.netezza.sql.NzConnection.updateResultSet(NzConnection.java:2704)
        at org.netezza.sql.NzResultSet.next(NzResultSet.java:1924)
        at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:237)
        at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:5

I am on Sqoop version: 1.4.6.2.3.2.0-2950.

2

2 Answers

1
votes

So, we learned this issue isn't related to sqoop at all. As it turns out, it was a bug with an older version of nzjdbc.jar. Upgrading this to the most recent version, and now sqoop is working without issue.

0
votes

We use ora_hash function to solve this problem with 5 mapper on oracle db.

--boundary-query 'select 1, 5 from dual' 
--query "select col1,col2,col3.... from (select *, ora_hash(rowid, 4) + 1 orah from db.table) where 1=1 AND \$CONDITIONS"