-
Notifications
You must be signed in to change notification settings - Fork 12
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
Ion String to Date type conversion is not supported #100
Comments
I'll share my thoughts. In my opinion, Ion defines a type spec to support different use cases (for example it supports decimal with arbitrary precision). Engines may not be able to fully support all of Ion's type spec, but can make a best effort to adhere as much as possible. "Best effort" is ambiguous and will look different if you leave it up to engines or end users to work around the limitations of the Ion SerDe. This hurts the portability of Ion across different engines. If the serdes does not define these conversions, then end users will either make their own parsing functions/libraries (devaluing this library) or rely on engines casting or functions (devaluing Ion's type spec, but adhering to the engines Type Spec). This means customers may get different values depending on the engine (example Presto vs Spark casts) or different values depending on their function implementation. If you define these transformations inside of the SerDes, then the Ion Hive SerDe becomes the de facto standard for "best effort support" of Ion types and customers may see more consistency across engines. While it's true that the Ion Spec may not specify these conversions, I think centralizing it in the library is a great way to get as close to Ion's true specfiication. |
This Hive language manual section on types says of timestamps:
Practically it looks like the Hive implementation of JsonSerde uses Hive's This seems like something we could incorporate into |
Given an Ion file
and a schema
ion-hive-serde
will throw an errorcom.amazon.ion.impl.lite.IonStringLite cannot be cast to com.amazon.ion.IonTimestamp
because an Ion string (within double quote above) cannot be cast to Hive date type in ion-hive-serde today.More specifically, we rely on object inspectors to convert Ion timestamp to Hive date but there is no Ion string to Hive date conversion support in ion-hive-serde.
Should we support conversion from Ion string to the Hive temporal types?
The text was updated successfully, but these errors were encountered: