[
https://issues.apache.org/jira/browse/SPARK-10533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993763#comment-14993763
]
Apache Spark commented on SPARK-10533:
--------------------------------------
User 'cloud-fan' has created a pull request for this issue:
https://github.com/apache/spark/pull/9482
> DataFrame filter is not handling float/double with Scientific Notation 'e' /
> 'E'
> ----------------------------------------------------------------------------------
>
> Key: SPARK-10533
> URL: https://issues.apache.org/jira/browse/SPARK-10533
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.4.1
> Reporter: Rishabh Bhardwaj
> Assignee: Adrian Wang
> Priority: Minor
> Labels: newbie
> Fix For: 1.6.0
>
>
> In DataFrames filter operation,when giving float comparison with e (2.0e2) it
> is not converting the comparison constant as expected (200.0 in this case).
> For example:
> {code}
> val df = sqlContext.createDataFrame(Seq(("a",1.0),("b",2.0),("c",3.0)))
> df.filter("_2 < 2.0e1").show()
> {code}
> {noformat}
> +--+---+
> |_1| _2|
> +--+---+
> | a|1.0|
> +--+---+
> {noformat}
> It should return all the three records from the dataframe,but is return
> record which is less than 2.0.
> It seems it is just comparing with the mantissa/coefficient.
> On the other hand,sqlContext is handling the above case and giving the
> desired output.
> {code}
> df.resgisterTempTable("df")
> sqlContext.sql("select * from df where `_2` < 2.0e1").show()
> {code}
> {noformat}
> +--+---+
> |_1| _2|
> +--+---+
> | a|1.0|
> | b|2.0|
> | c|3.0|
> +--+---+
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]