You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Danny Antonetti <da...@gmail.com> on 2012/04/03 03:06:49 UTC

Sqoop merge with Avro problem

I am using the Avro format.

I currently have sqoop setup to do an initial full dump, or an incremental
dump and then a merge from the previous full dump.

But the merge fails with the following error


java.lang.NumberFormatException: For input string: "Obj avro.schema{""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:410)
at java.lang.Long.valueOf(Long.java:525)
at com.test.hadoop.sqoop.clients.__loadFromFields(clients.java:310)
at com.test.hadoop.sqoop.clients.parse(clients.java:260)

FULL import
sqoop import
--class-name "$TABLE"
--verbose
--as-avrodatafile
--null-non-string=""
--columns $COLUMNS
--incremental "append"
--null-string=""
--compress
--compression-codec=snappy
--check-column "object_version"
--append
--fields-terminated-by=\t
--where "$WHERE"
--connect jdbc:mysql://$SERVER:3306/database
--password=$PASSWORD
--username=$USERNAME
--table=$TABLE
--target-dir $OUTPUTDIR


Incremental import
sqoop import
--class-name "$TABLE"
--verbose
--as-avrodatafile
--null-non-string=''
--columns $COLUMNS
--incremental 'append'
--null-string=''
--compress
--compression-codec=snappy
--check-column 'object_version'
--append
--fields-terminated-by=\t
--where "$WHERE"
--connect jdbc:mysql://$SERVER:3306/database
--password=$PASSWORD
--username=$USERNAME
--table=$TABLE
--target-dir $OUTPUTDIR
--last-value "$LAST_VALUE"



sqoop merge
--verbose
--merge-key $MERGE_KEY
--new-data $SERVEROUTPUTDIRHOURLY
--target-dir $OUTPUTDIRCOMPLETE
--onto $OLD_OUPUTDIRCOMPLETE
--class-name $TABLE