I m trying to sqoop export the data from hive to teradata. If the data in hive is null, its exporting "\N" to teradata database. I have used below two parameters and tried putting as ' ' Or 'null' Or '\\\\N' etc....But every time its exporting only \N.
My requirement is to export null to teradata if there is null in hive. Can someone help me out.
Connector i am using is Teradata Hortonworks connector : --connection manager org.apache.sqoop.teradata.TeradataConn Manager
I have tried giving that too like --input-null-string '\\N' --input-null-non-string '\\N' but still exporting \N to teradata but not null.
have you seen this? You can define your own NULL types in Hive when you create tables, so in your case, define NULL type that Teradata can understand. LINK.
You can create tables with a custom SerDe or using a native SerDe. A native SerDe is used if ROW FORMAT is not specified or ROW FORMAT DELIMITED is specified. You can use the DELIMITED clause to read delimited files, and you can enable escaping for the delimiter characters by using the 'ESCAPED BY' clause (such as ESCAPED BY '\') – escaping is needed if you want to work with data that can contain these delimiter characters. A custom NULL format can also be specified using the 'NULL DEFINED AS' clause (default is '\N'). Use the SERDE clause to create a table with a custom SerDe.
Hi my friend,
I was with the same problem (using hive and sqoop to export) and i resolved putting that argument on hive create table:
NULL DEFINED AS "null"