Sqoop import data time date type error, sqoop import data date
A problem has been plagued for a long time. When sqoop import is used to import data from a mysql database to HDFS, an error is reported until an invalid value of the time and date type is found.
Hive only supports the timestamp type, while the date type in mysql is datetime. When the datetime value is 0000-00-00 00:00:00, sqoop import is successful, however, an error is returned when the select statement is executed in hive to query this field.
The solution is to use the string field type when creating a hive table.
An error is prompted when SQL character text is converted to date
1. Different Storage scopes
SMALLDATETIME: the date and time data from January 1, January 1-20, 1900 to January 1, June 6 are accurate to minutes.
DATETIME: Date and time data of January 1
2. Different Storage precision
SMALLDATETIME: The data is accurate to minutes.
DATETIME: precision is 3% seconds (equal to 3.33 milliseconds or 0.00333 seconds)
An error occurred while importing excel Data to the SQL SERVER 2000 Time column.
In SqlServer, change the date field of the table to the datetime type.
After an import error occurs, you should have a table in SqlServer. You can clear the table data and change the date field type to the datetime type, then select the modified table as you enter it. Try it now. Wish you a good luck.