This has to do with how you are creating the timestamp object from the 
resultset ( I guess).
If you can provide more code it will help, but you could surround the parsing 
code with a try catch and then just ignore the exception.

From: Aviral Agarwal [mailto:aviral12...@gmail.com]
Sent: Wednesday, June 21, 2017 2:37 PM
To: user@spark.apache.org
Subject: JDBC RDD Timestamp Parsing Issue

Hi,

I am using JDBC RDD to read from a MySQL RDBMS.
My spark job fails with the below error :


java.sql.SQLException: Value '0000-00-00 00:00:00.000' can not be represented 
as java.sql.Timestamp


Now instead of the whole job failing I want to skip this record and continue 
processing the rest.
Any leads on how that can be done ?


Thanks and Regards,
Aviral Agarwal
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

Reply via email to