Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Support for logical datatype like decimal type #257

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

varsha-abhinandan
Copy link

This pull request is in context to - #121 which was done by @cpbhagtani to support the logical types. This current PR adds this support for spark 2.x

@codecov-io
Copy link

codecov-io commented Nov 27, 2017

Codecov Report

Merging #257 into master will increase coverage by 0.61%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #257      +/-   ##
==========================================
+ Coverage   90.77%   91.38%   +0.61%     
==========================================
  Files           5        5              
  Lines         336      360      +24     
  Branches       50       55       +5     
==========================================
+ Hits          305      329      +24     
  Misses         31       31

@gengliangwang
Copy link
Contributor

In Avro spec:

A decimal logical type annotates Avro bytes or fixed types

Can you handle bytes and fixed type as well?

@cbia4
Copy link

cbia4 commented Jan 18, 2018

Is there any movement on this? I have yet to find a way to load avro data into a data frame where data with type bytes (and logical type decimal with scale and precision) is converted back to a human readable form.

@cbia4
Copy link

cbia4 commented Jan 19, 2018

I updated the avro package version and rebuilt SchemaConverters.scala with something similar to what is in the PR - except like I mentioned, Avro 1.8.2 stores the decimal logical type as bytes, and you need to use Conversions.DecimalConversion from the avro API to make it happen, but it works as expected for anyone who needs to get this to work with decimal types.

@peter-ungvari
Copy link

@cbia4 Where can I find your changes?
Is there another PR for bytes avro type?

I am ready to work on this in order to make spark-avro compatible with avro spec as well as Hive regarding to decimal types.

@LuboVarga
Copy link

I wish this project is in maven... I am more familiar with it. But I can promise to share result of my work (decimal type for bytes and fixed types and perhaps timestamp logical type)

@koertkuipers
Copy link
Contributor

koertkuipers commented Jun 8, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants