spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <ja...@japila.pl>
Subject [SQL] Two columns in output vs one when joining DataFrames?
Date Fri, 25 Mar 2016 20:19:00 GMT
Hi,

I've read the note about both columns included when DataFrames are
joined, but don't think it differentiated between versions of join. Is
this a feature or a bug that the following session shows one _1 column
with Seq("_1") and two columns for ===?

{code}
scala> left.join(right, Seq("_1")).show
+---+---+---+
| _1| _2| _2|
+---+---+---+
|  1|  a|  a|
|  2|  b|  b|
+---+---+---+


scala> left.join(right, left("_1") === right("_1")).show
+---+---+---+---+
| _1| _2| _1| _2|
+---+---+---+---+
|  1|  a|  1|  a|
|  2|  b|  2|  b|
+---+---+---+---+
{code}

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