spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <>
Subject Re: Can Spark Dataframes preserve order when joining?
Date Wed, 29 Jun 2016 22:38:00 GMT

Well I would not assume anything myself. If you want to order it do it

Let us take a simple case by creating three DFs based on existing tables

val s =
val c = HiveContext.table("channels").select("CHANNEL_ID","CHANNEL_DESC")
val t = HiveContext.table("times").select("TIME_ID","CALENDAR_MONTH_DESC")

now let us join these tables

val rs =

And do ab order explicitly

val rs1 = rs.*orderBy*


Dr Mich Talebzadeh

LinkedIn *

*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.

On 29 June 2016 at 14:32, Jestin Ma <> wrote:

> If it’s not too much trouble, could I get some pointers/help on this? (see
> link)
> -also, as a side question, do Dataframes support easy reordering of
> columns?
> Thank you!
> Jestin

View raw message