zy-kkk commented on issue #34460:
URL: https://github.com/apache/doris/issues/34460#issuecomment-2100049041

   This is because the default handling of illegal Date/DateTime in JDBC is to 
throw an exception, and this behavior can be controlled through the parameter 
zeroDateTimeBehavior.
   
   The optional parameters are: EXCEPTION, CONVERT_TO_NULL, ROUND, 
respectively: exception error reporting, converted to NULL value, converted to 
"0001-01-01 00:00:00";
   
   You need to add zeroDateTimeBehavior=convertToNull to the end of the JDBC 
connection string when creating the catalog jdbc_url, such as "jdbc_url" = 
"jdbc:mysql://127.0.0.1:3306/test?zeroDateTimeBehavior=convertToNull" In this 
case, JDBC will convert 0000-00-00 or 0000-00-00 00:00:00 into null, and then 
Doris will process all Date/DateTime type columns in the current catalog as 
nullable types, so that It can be read normally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to