Support Questions
Find answers, ask questions, and share your expertise

When importing data from sql server to hive not copying same data type

When importing data from sql server to hive not copying same data type

Hi,

I try to import tables from Sql Server to hive, but after checking fields are set to STRING but the data type on Sql Server is nvarchar, is there code to copy the same data type when importing?

1 REPLY 1
Highlighted

Re: When importing data from sql server to hive not copying same data type

Hi @Harold Allen Badilla. By default sqoop creates a hive table based on the predefined data type conversion logic build inside sqoop. For Example: Number, datatime is not available in hive. Instead float,decimal,timestamp are the corresponding datatype available in hive. If sqoop comes under such case then it converts the data type into string such that the particular column in hive will not show NULL for all the records.

Have a look at this link if you need to convert it while importing into hive.

https://amalgjose.com/2015/07/27/changing-the-data-type-mapping-in-sqoop/