You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/08/29 01:44:00 UTC

[jira] [Resolved] (SPARK-36589) Creating a value in json which represents decimal

     [ https://issues.apache.org/jira/browse/SPARK-36589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-36589.
----------------------------------
    Resolution: Not A Problem

> Creating a value in json which represents decimal 
> --------------------------------------------------
>
>                 Key: SPARK-36589
>                 URL: https://issues.apache.org/jira/browse/SPARK-36589
>             Project: Spark
>          Issue Type: Question
>          Components: Spark Core
>    Affects Versions: 3.1.2
>            Reporter: Anuradha Bhan
>            Priority: Major
>
> Hi,
>  
> I have a json which have some decimal values . This json is read by Spark like the following : 
> Dataset<Row> df = spark.read().format("json").option("multiline","true").load("/home/user/work/Parquet/output.json");
>  
> The schema generated by this (df.printschema) shows the decimal value as double and not decimal .  
> My requirement is that it should read the value as decimal only. 
> Now to do this, I want change the value in json (while creating the json) in such a way or format that spark reads it as decimal only .
> And in this conversion method, I need to apply the precision and scale also
> Please let me know how this can be done 
>  
> Thanks and Regards
> Anuradha  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org