Sqoop import data time date type error, sqoop import data date

Source: Internet
Author: User
Tags sqoop

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.