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

Add types #49

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

Add types #49

wants to merge 4 commits into from

Conversation

hesserp
Copy link
Contributor

@hesserp hesserp commented Feb 10, 2021

Add support for decimal type #43 and timestamp type #37

decimal type has optional parameters precision and range (spark default are 10 and 0).
example:

"decimal_field": {
  "type": "decimal",
  "precision": 38,
  "range": 18
}

when using a timestamp field you may provide a format on loading the data, e.g.

sparkSession.read.schema(schema).options(Map("timestampFormat" -> "yyyy-MM-dd HH:mm:ss")).json("path/to/data")

@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #49 (08cae3c) into master (d5d8677) will increase coverage by 1.50%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
+ Coverage   91.56%   93.06%   +1.50%     
==========================================
  Files           1        1              
  Lines          83      101      +18     
  Branches        1        1              
==========================================
+ Hits           76       94      +18     
  Misses          7        7              
Impacted Files Coverage Δ
...org/zalando/spark/jsonschema/SchemaConverter.scala 93.06% <100.00%> (+1.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5d8677...08cae3c. Read the comment docs.

@zzeekk
Copy link

zzeekk commented Dec 25, 2021

Support of timestamp and decimal datatypes would be very interesting. Is there a plan to merge this PR?

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 this pull request may close these issues.

2 participants