java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

Puneet Kinra-2
Hi 
 
I am getting the above error when deployed to the cluster ,trying to set the System Property but not getting reflected inside the jobs.

I need to schedule the job as well on periodic basis , i was thinking of calling the 
jar from the CLI & put into script & schedule using cron job in linux 

but stuck with the below issue.


java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
        at org.apache.flink.api.common.typeutils.base.SqlTimestampSerializer.serialize(SqlTimestampSerializer.java:27)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:160)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:46)
        at org.apache.flink.runtime.plugable.SerializationDelegate.write(SerializationDelegate.java:54)
        at org.apache.flink.runtime.io.network.api.serialization.SpanningRecordSerializer.addRecord(SpanningRecordSerializer.java:93)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.sendToTarget(RecordWriter.java:114)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:89)
        at org.apache.flink.runtime.operators.shipping.OutputCollector.collect(OutputCollector.java:65)
        at org.apache.flink.runtime.operators.util.metrics.CountingCollector.collect(CountingCollector.java:35)
        at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:168)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
        at java.lang.Thread.run(Unknown Source)

--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

Timo Walther
Hi Puneet,

Flink SQL does only supports java.sql.Timestamp. You need to convert it in a user-defined function or map function accordingly.

Regards,
Timo



Am 1/22/18 um 11:38 AM schrieb Puneet Kinra:
Hi 
 
I am getting the above error when deployed to the cluster ,trying to set the System Property but not getting reflected inside the jobs.

I need to schedule the job as well on periodic basis , i was thinking of calling the 
jar from the CLI & put into script & schedule using cron job in linux 

but stuck with the below issue.


java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
        at org.apache.flink.api.common.typeutils.base.SqlTimestampSerializer.serialize(SqlTimestampSerializer.java:27)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:160)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:46)
        at org.apache.flink.runtime.plugable.SerializationDelegate.write(SerializationDelegate.java:54)
        at org.apache.flink.runtime.io.network.api.serialization.SpanningRecordSerializer.addRecord(SpanningRecordSerializer.java:93)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.sendToTarget(RecordWriter.java:114)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:89)
        at org.apache.flink.runtime.operators.shipping.OutputCollector.collect(OutputCollector.java:65)
        at org.apache.flink.runtime.operators.util.metrics.CountingCollector.collect(CountingCollector.java:35)
        at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:168)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
        at java.lang.Thread.run(Unknown Source)

--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

Timo Walther
According to Stackoverflow (https://stackoverflow.com/questions/13269564/java-lang-classcastexception-oracle-sql-timestamp-cannot-be-cast-to-java-sql-ti) setting the system property accordingly should work.

Maybe you can share how you do it?

Regards,
Timo


Am 1/22/18 um 11:45 AM schrieb Puneet Kinra:
I am getting this issue while reading from the database using jdbc connector , can you guide me how to read 
from there as  a string or may mapped to another type while reading from the database

On Mon, Jan 22, 2018 at 4:12 PM, Timo Walther <[hidden email]> wrote:
Hi Puneet,

Flink SQL does only supports java.sql.Timestamp. You need to convert it in a user-defined function or map function accordingly.

Regards,
Timo



Am 1/22/18 um 11:38 AM schrieb Puneet Kinra:
Hi 
 
I am getting the above error when deployed to the cluster ,trying to set the System Property but not getting reflected inside the jobs.

I need to schedule the job as well on periodic basis , i was thinking of calling the 
jar from the CLI & put into script & schedule using cron job in linux 

but stuck with the below issue.


java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
        at org.apache.flink.api.common.typeutils.base.SqlTimestampSerializer.serialize(SqlTimestampSerializer.java:27)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:160)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:46)
        at org.apache.flink.runtime.plugable.SerializationDelegate.write(SerializationDelegate.java:54)
        at org.apache.flink.runtime.io.network.api.serialization.SpanningRecordSerializer.addRecord(SpanningRecordSerializer.java:93)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.sendToTarget(RecordWriter.java:114)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:89)
        at org.apache.flink.runtime.operators.shipping.OutputCollector.collect(OutputCollector.java:65)
        at org.apache.flink.runtime.operators.util.metrics.CountingCollector.collect(CountingCollector.java:35)
        at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:168)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
        at java.lang.Thread.run(Unknown Source)

--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]






--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

Timo Walther
You have to make sure that the property is set on every TaskManager that executes your job.

I don't know if there is some easier way to set the system properties on the entire cluster.


Am 1/22/18 um 12:25 PM schrieb Puneet Kinra:
Interesting System property working while submitting from the portal not working when 
submitting job from the CLI.

On Mon, Jan 22, 2018 at 4:42 PM, Puneet Kinra <[hidden email]> wrote:
I tried but System property are not visible to the jobs,

On Mon, Jan 22, 2018 at 4:20 PM, Timo Walther <[hidden email]> wrote:
According to Stackoverflow (https://stackoverflow.com/questions/13269564/java-lang-classcastexception-oracle-sql-timestamp-cannot-be-cast-to-java-sql-ti) setting the system property accordingly should work.

Maybe you can share how you do it?

Regards,
Timo


Am 1/22/18 um 11:45 AM schrieb Puneet Kinra:
I am getting this issue while reading from the database using jdbc connector , can you guide me how to read 
from there as  a string or may mapped to another type while reading from the database

On Mon, Jan 22, 2018 at 4:12 PM, Timo Walther <[hidden email]> wrote:
Hi Puneet,

Flink SQL does only supports java.sql.Timestamp. You need to convert it in a user-defined function or map function accordingly.

Regards,
Timo



Am 1/22/18 um 11:38 AM schrieb Puneet Kinra:
Hi 
 
I am getting the above error when deployed to the cluster ,trying to set the System Property but not getting reflected inside the jobs.

I need to schedule the job as well on periodic basis , i was thinking of calling the 
jar from the CLI & put into script & schedule using cron job in linux 

but stuck with the below issue.


java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
        at org.apache.flink.api.common.typeutils.base.SqlTimestampSerializer.serialize(SqlTimestampSerializer.java:27)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:160)
        at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:46)
        at org.apache.flink.runtime.plugable.SerializationDelegate.write(SerializationDelegate.java:54)
        at org.apache.flink.runtime.io.network.api.serialization.SpanningRecordSerializer.addRecord(SpanningRecordSerializer.java:93)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.sendToTarget(RecordWriter.java:114)
        at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:89)
        at org.apache.flink.runtime.operators.shipping.OutputCollector.collect(OutputCollector.java:65)
        at org.apache.flink.runtime.operators.util.metrics.CountingCollector.collect(CountingCollector.java:35)
        at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:168)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
        at java.lang.Thread.run(Unknown Source)

--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]






--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]






--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]





--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]