Re: sort descending with multiple columns

2016-11-21 Thread Sreekanth Jella
(2, "D"), > (3, "E") > ).toDF("foo", "bar") > > val colList = Seq("foo", "bar") > df.sort(colList.map(col(_).desc): _*).show > > +---+---+ > |foo|bar| > +---+---+ > | 3| E| > | 2| D| > | 1| C| &g

sort descending with multiple columns

2016-11-17 Thread Sreekanth Jella
Hi, I'm trying to sort multiple columns and column names are dynamic. df.sort(colList.head, colList.tail: _*) But I'm not sure how to sort in descending order for all columns, I tried this but it's for only first column.. df.sort(df.col(colList.head).desc) How can I pass all column names (or

Spark Metrics monitoring using Graphite

2016-10-26 Thread Sreekanth Jella
Hi All, I am trying to retrieve the spark metrics using Graphite Exporter. It seems by default it is exposing the Application ID, but as per the our requirements we need Application Name. Sample GraphiteExporter data: block_manager{application="local-1477496809940",executor_id="driver",instance="

RE: Flattening XML in a DataFrame

2016-08-16 Thread Sreekanth Jella
Hi Experts, Please suggest. Thanks in advance. Thanks, Sreekanth From: Sreekanth Jella [mailto:srikanth.je...@gmail.com] Sent: Sunday, August 14, 2016 11:46 AM To: 'Hyukjin Kwon' <gurwls...@gmail.com> Cc: 'user @spark' <user@spark.apache.org> Subject: Re: Fl

Re: Flattening XML in a DataFrame

2016-08-14 Thread Sreekanth Jella
rdinates.clerk) as clerk") .selectExpr("id", "name", "clerk.cid", "clerk.cname") .show() would print the results below as you want: +---++---+-+ | id|name|cid|cname| +---++---+-+ | 1| foo| 1| foo| | 1| foo| 1| foo|

Flattening XML in a DataFrame

2016-08-12 Thread Sreekanth Jella
1 foo Expected output: id, name, clerk.cid, clerk.cname 1, foo, 2, cname2 1, foo, 3, cname3 Thanks, Sreekanth Jella