spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anuradha Bhan (Jira)" <>
Subject [jira] [Created] (SPARK-36589) Creating a value in json which represents decimal
Date Wed, 25 Aug 2021 14:57:00 GMT
Anuradha Bhan created SPARK-36589:

             Summary: Creating a value in json which represents decimal 
                 Key: SPARK-36589
             Project: Spark
          Issue Type: Question
          Components: Spark Core
    Affects Versions: 3.1.2
            Reporter: Anuradha Bhan



I have a json which have some decimal values . This json is read by Spark like the following

Dataset<Row> df ="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





This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message