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.

sqoop script gives me error? "java.lang.nullpointer exception" any budy has fresh idea

Highlighted

sqoop script gives me error? "java.lang.nullpointer exception" any budy has fresh idea

for i in `cat script.txt`; do dbname=`echo $i |cut -d. -f1`;column=`echo $i |cut -d. -f2`; schema=`echo $i |cut -d. -f3`; table=`echo $i |cut -d. -f4`; echo sqoop import --connect jdbc:netezza://hostname/$dbname --username user --password pass --query "'select * from $dbname.$schema.$table WHERE "'$CONDITIONS'"'" --hive-import --target-dir /tmp/test1 --hive-table $dbname.$table --split-by $column; done

2016-03-08 13:51:56,742 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:51:56,759 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:51:56,760 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:51:56,760 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:51:56,914 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:51:56,920 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:52:07,284 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 13:52:10,663 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:52:10,685 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:52:10,686 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:52:10,687 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:52:10,852 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:52:10,857 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:52:21,313 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 13:52:24,727 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:52:24,744 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:52:24,745 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:52:24,745 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:52:24,893 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:52:24,897 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:52:25,371 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) at --split-by $column; done 2016-03-08 13:56:55,858 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:56:55,872 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:56:55,873 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:56:55,873 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:56:56,015 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:56:56,020 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:56:56,656 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 13:56:59,934 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:56:59,950 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:56:59,951 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:56:59,951 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:57:00,192 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:57:00,202 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:57:00,672 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 13:57:03,886 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 13:57:03,901 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 13:57:03,902 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 13:57:03,902 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 13:57:04,052 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 13:57:04,056 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 13:57:04,854 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) [vpanshe@cmtoldelkkapp02 test]$ clear [vpanshe@cmtoldelkkapp02 test]$ sh script.sh 2016-03-08 14:00:00,399 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 14:00:00,419 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 14:00:00,420 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 14:00:00,420 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 14:00:00,636 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 14:00:00,643 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 14:00:11,044 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 14:00:14,242 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 14:00:14,260 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 14:00:14,261 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 14:00:14,261 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 14:00:14,400 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 14:00:14,404 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 14:00:14,750 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) 2016-03-08 14:00:17,835 INFO - [main:] ~ Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-08 14:00:17,850 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead. (BaseSqoopTool:1021) 2016-03-08 14:00:17,851 INFO - [main:] ~ Using Hive-specific delimiters for output. You can override (BaseSqoopTool:1353) 2016-03-08 14:00:17,851 INFO - [main:] ~ delimiters with --fields-terminated-by, etc. (BaseSqoopTool:1354) 2016-03-08 14:00:18,004 INFO - [main:] ~ Using default fetchSize of 1000 (SqlManager:98) 2016-03-08 14:00:18,008 INFO - [main:] ~ Beginning code generation (CodeGenTool:92) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.3.0.0-2557/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2016-03-08 14:00:38,713 ERROR - [main:] ~ Got exception running Sqoop: java.lang.NullPointerException (Sqoop:181) java.lang.NullPointerException at org.netezza.sql.NzPreparedStatament.prepare(NzPreparedStatament.java:1108) at org.netezza.sql.NzPreparedStatament.<init>(NzPreparedStatament.java:89) at org.netezza.sql.NzConnection.prepareStatement(NzConnection.java:1553) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) 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) Add comment Hide 1

2 REPLIES 2
Highlighted

Re: sqoop script gives me error? "java.lang.nullpointer exception" any budy has fresh idea

Hard to tell based on yuor message. Can you show us the specific sqoop command failing, after all variable substitutions. Could be something related to Netezza. By the way, why are you using query type when importing all columns? Is that required by Netezza driver?

Highlighted

Re: sqoop script gives me error? "java.lang.nullpointer exception" any budy has fresh idea

Yes because netezza have table name db.schema.tablename and this table table sqoop cant take it.

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