Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison between java.util.Date & java.sql.Timestamp errors out in specific cases #2045

Closed
blitzmohit opened this issue Apr 30, 2021 · 0 comments · Fixed by #2047
Closed

Comments

@blitzmohit
Copy link
Contributor

Inmemory comparison between java.util.Date & java.sql.Timestamp throws an exception when the ISO8601DateSerde is registered to handle these.

Expected Behavior

The comparison in such cases should not throw an exception

Current Behavior

Observed in cases where the incoming string filter is converted into Date and compared with a Timestamp, currently the conversion fails since the registered serde does not handle Date to Timestamp conversion.

Convert type 'java.util.Date' value 'Mon Sep 14 22:00:00 EDT 2020' to type 'java.sql.Timestamp'
 Using converter com.yahoo.elide.utils.coerce.CoerceUtil$1@50fa99c0
java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap')
	at com.yahoo.elide.utils.coerce.converters.ISO8601DateSerde.deserialize(ISO8601DateSerde.java:18)
	at com.yahoo.elide.utils.coerce.CoerceUtil$1.convert(CoerceUtil.java:71)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant