- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Sqoop from Oracle to Hive table
- Labels:
-
Apache Hive
-
Apache Sqoop
Created ‎01-24-2019 09:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
I am using this sqoop command for importing Oracle Table into Hive Table
sqoop import --connect jdbc:oracle:thin:@123.123.123.112:1500:COL --username admin -P --table db.table1 --hive-import --hive-overwrite --create-hive-table --hive-database hive_db --hive-table table1 --split-by primary_Key
After Importing from oracle to Hive
Some rows and columns are entirely Showing 'NULL' .
ORACLE TABLE | HIVE TABLE -ISSUE |
1. PRIMARY_KEY (NOT NULL COLUMN) 2. There is 0 'NULL' Value |
1. SOME ROWS AND COLUMNS ARE NULL 2. 35 NULL (ROWS and COLUMS) |
How to clear it?
Created ‎01-24-2019 11:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you to define field delimiter (--fields-terminated-by <char>). Looks like your data has values with comma (which is the default delimiter) and that is creating issues.
Created ‎01-24-2019 11:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you to define field delimiter (--fields-terminated-by <char>). Looks like your data has values with comma (which is the default delimiter) and that is creating issues.
Created ‎01-25-2019 04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Siva A Thankyou
field delimiter (--fields-terminated-by | ) and field delimiter (--fields-terminated-by ~) used '\020' Solved my issue
Created ‎01-26-2019 01:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using the import control options, you can find them here - https://sqoop.apache.org/docs/1.4.3/SqoopUserGuide.html e.g The --null-string
and --null-non-string
arguments are optional.\ If not specified, then the string "null" will be used.
HTH
Created ‎01-29-2019 07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Geoffrey Shelton Okot tried your answers
--null-string
and --null-non-string
Still Facing Same Issues.
we are using oracle11g type DB and tables as source to hive as destination .Is there any Datatype kinds of issue is there?
Created ‎02-01-2019 10:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sqoop will by default import NULL values as string null. Hive is, however, using string \N to denote NULL values and therefore predicates dealing with NULL (like IS NULL) will not work correctly. You should append parameters --null-string and --null-non-string in case of import job or --input-null-string and --input-null-non-string in case of an export job if you wish to properly preserve NULL values.
Because sqoop is using those parameters in generated code, you need to properly escape value \N to \N:
HTH
Created ‎02-06-2019 04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
