spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <ja...@japila.pl>
Subject [SQL] A bug with withColumn?
Date Thu, 31 Mar 2016 19:08:19 GMT
Hi,

Just ran into the following. Is this a bug?

scala> df.join(nums, df("id") === nums("id")).withColumn("TEXT2", lit(5)).show
+---+-------+---+-----+-----+
| id|   text| id| text|TEXT2|
+---+-------+---+-----+-----+
|  0|  hello|  0|  two|    5|
|  1|swiecie|  1|three|    5|
+---+-------+---+-----+-----+


scala> df.join(nums, df("id") === nums("id")).withColumn("TEXT", lit(5)).show
+---+----+---+----+
| id|TEXT| id|TEXT|
+---+----+---+----+
|  0|   5|  0|   5|
|  1|   5|  1|   5|
+---+----+---+----+

Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski

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


Mime
View raw message