hadoop - Sqoop creating insert statements containing multiple records -
we trying load data sqoop netezza. , facing following issue.
java.io.ioexception: org.netezza.error.nzsqlexception: error:
example input dataset shown below:
1,2,3
1,3,4
sqoop command shown below:
sqoop export --table <tablename> --export-dir <path> --input-fields-terminated-by '\t' --input-lines-terminated-by '\n' --connect 'jdbc:netezza://<host>/<db>' --driver org.netezza.driver --username <username> --password <passwrd>
the sqoop creating insert statement in following way:
insert (c1,c2,c3) values (1,2,3),(1,3,4).
we able load 1 record when try load data multiple records, error said above.
your highly appreciated.
making sqoop.export.records.per.statement=1 make export process extremely slow if export record count large "5 million".
to solve need add following things:
1.) properties file sqoop.properties, must contain property jdbc.transaction.isolation=transaction_read_uncommitted (it avoids deadlock during exports)
also in export command need specify this:
--connection-param-file /path/to/sqoop.properties
2.) sqoop.export.records.per.statement=100, making increase speed of export.
3.) third have add --batch, use batch mode underlying statement execution.
so final export this,
sqoop export -d sqoop.export.records.per.statement=100 --table <tablename> --export-dir <path> --input-fields-terminated-by '\t' --input-lines-terminated-by '\n' --connect 'jdbc:netezza://<host>/<db>' --driver org.netezza.driver --username <username> --password <passwrd> --connection-param-file /path/to/sqoop.properties --batch
hope help.
Comments
Post a Comment