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

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


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?


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.

; ;