[
https://issues.apache.org/jira/browse/SPARK-34825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17307623#comment-17307623
]
Hyukjin Kwon commented on SPARK-34825:
--------------------------------------
It treats as a string properly. It just internally casts to numbers when it
compares.
> pyspark.sql.function.lit is treating '1' the same as 1
> ------------------------------------------------------
>
> Key: SPARK-34825
> URL: https://issues.apache.org/jira/browse/SPARK-34825
> Project: Spark
> Issue Type: Bug
> Components: PySpark
> Affects Versions: 2.4.4
> Reporter: yu peng
> Priority: Major
>
> In [10]: import pyspark.sql.functions as F
> In [11]: df.withColumn('x', F.lit('1')==F.lit(1)).show()
> +---+---+---------+----+
> | a| b| c| x|
> +---+---+---------+----+
> | 1| 2| x > y|true|
> | 0| 4|a > b > c|true|
> +---+---+---------+----+
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]