You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
I have a hive table containing decimal values;
I'm loading the data in a spark dataframe using hiveContext; in dataframe the decimal values are loaded as decimal(s,p)
When I save the dataframe to avro format the decimals are converted and saves as string data types
How can I save these fields to avro in Bytes format with Decimal LogicalType insted of string?
Thanks,
The text was updated successfully, but these errors were encountered:
Hey @eliviu
spark-avro currently doesn't support Decimal LogicalType. And hence decimal type is converted to String. You can look at the code for conversion in the function createConverterToAvro in AvroOutputWriter.scala
There was a PR to support Decimal LogicalType but it hasn't been merged. You can still take a look - #121
Ok, but for reading (not writing) there is support for Decimal?
When I read a Decimal datatype I get the value in hexadecimal (ex. for 3.12 I get [01 38] ). How can I convert this in other datatype using spark-avro (ex. convert-it in String or Decimal and get the "3.12" value)?
Is there any update on this? I also get hex values for columns with an avro type of "bytes" and have not found anything useful to convert these columns back to a decimal type. As an example, my avro schema looks like this for one of the columns
Hi,
I have a hive table containing decimal values;
I'm loading the data in a spark dataframe using hiveContext; in dataframe the decimal values are loaded as decimal(s,p)
When I save the dataframe to avro format the decimals are converted and saves as string data types
How can I save these fields to avro in Bytes format with Decimal LogicalType insted of string?
Thanks,
The text was updated successfully, but these errors were encountered: