Re: Spark 1.6.0: substring on df.select

2016-05-12 Thread Sun Rui
: Bharathi Raja [mailto:raja...@yahoo.com.INVALID] > Sent: 12 May 2016 11:40 > To: Raghavendra Pandey ; Bharathi Raja > > Cc: User > Subject: RE: Spark 1.6.0: substring on df.select > > Thanks Raghav. > > I have 5+ million records. I feel creating multiple come

RE: Spark 1.6.0: substring on df.select

2016-05-12 Thread Ewan Leith
tUdf = udf(lastElement(_:String)) df.select(lastElementUdf ($"col1")).show() Ewan From: Bharathi Raja [mailto:raja...@yahoo.com.INVALID] Sent: 12 May 2016 11:40 To: Raghavendra Pandey ; Bharathi Raja Cc: User Subject: RE: Spark 1.6.0: substring on df.select Thanks Raghav. I have 5+ mil

RE: Spark 1.6.0: substring on df.select

2016-05-12 Thread Bharathi Raja
: Spark 1.6.0: substring on df.select You can create a column with count of /.  Then take max of it and create that many columns for every row with null fillers. Raghav On 11 May 2016 20:37, "Bharathi Raja" wrote: Hi,   I have a dataframe column col1 with values something like “/clie

Re: Spark 1.6.0: substring on df.select

2016-05-11 Thread Raghavendra Pandey
You can create a column with count of /. Then take max of it and create that many columns for every row with null fillers. Raghav On 11 May 2016 20:37, "Bharathi Raja" wrote: Hi, I have a dataframe column col1 with values something like “/client/service/version/method”. The number of “/” are

Spark 1.6.0: substring on df.select

2016-05-11 Thread Bharathi Raja
Hi, I have a dataframe column col1 with values something like “/client/service/version/method”. The number of “/” are not constant. Could you please help me to extract all methods from the column col1? In Pig i used SUBSTRING with LAST_INDEX_OF(“/”). Thanks in advance. Regards, Raja