You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by zzuly2010 <zz...@163.com> on 2023/01/04 10:54:00 UTC

回复:[Bug] dataframe.show() prints incorrect numbers

Hi,


     Maybe you can use the show(truncate: Boolean)  API to display your data. 






在 2023年1月4日 18:26,Yaakov (Agoda)" <ya...@agoda.com.INVALID> 写道:


What is the right process for reporting this bug in spark?
 
SUMMARY: For some small numbers, dataframe.show() chops off the exponential field showing wrong numbers instead.
 
HOW TO REPRODUCE THE BUG: This is a one-liner on the command line:
echo 'Seq((1.8181682328650097E-4)).toDF("x").show()' | docker run -i apache/spark /opt/spark/bin/spark-shell
 
WHAT IS THE OUTPUT:
scala> Seq((1.8181682328650097E-4)).toDF("x").show()
+--------------------+
|                   x|
+--------------------+
|1.818168232865009...|
+--------------------+
 
WHAT SHOULD BE THE CORRECT OUTPUT:
scala> Seq((1.8181682328650097E-4)).toDF("x").show()
+--------------------+
|                   x|
+--------------------+
|1.818168232865009E-4|
+--------------------+
 
 
Please advise how to report this bug.
 
Yaakov Belch
 
 
 
 


This message is confidential and is for the sole use of the intended recipient(s). It may also be privileged or otherwise protected by copyright or other legal rules. If you have received it by mistake please let us know by reply email and delete it from your system. It is prohibited to copy this message or disclose its content to anyone. Any confidentiality or privilege is not waived or lost by any mistaken delivery or unauthorized disclosure of the message. All messages sent to and from Agoda may be monitored to ensure compliance with company policies, to protect the company's interests and to remove potential malware. Electronic messages may be intercepted, amended, lost or deleted, or contain viruses.