Re: Check if dataframe is empty

2017-03-07 Thread Deepak Sharma
On Tue, Mar 7, 2017 at 2:37 PM, Nick Pentreath wrote: > df.take(1).isEmpty should work My bad. It will return empty array: emptydf.take(1) res0: Array[org.apache.spark.sql.Row] = Array() and applying isEmpty would return boolean emptydf.take(1).isEmpty res2:

Re: Check if dataframe is empty

2017-03-07 Thread Nick Pentreath
, March 07, 2017 9:22 AM > *To:* user@spark.apache.org > *Subject:* Check if dataframe is empty > > > > Hello! > > > > I am pretty sure that I am asking something which has been already asked > lots of times. However, I cannot find the question in the mailing list > archive

Re: Check if dataframe is empty

2017-03-06 Thread Deepak Sharma
h.com [mailto:ashaita...@nz.imshealth.com] > *Sent:* Tuesday, March 07, 2017 9:22 AM > *To:* user@spark.apache.org > *Subject:* Check if dataframe is empty > > > > Hello! > > > > I am pretty sure that I am asking something which has been already asked > lots of times. However,

RE: Check if dataframe is empty

2017-03-06 Thread AShaitarov
...@accenture.com [mailto:jasbir.s...@accenture.com] Sent: Tuesday, 7 March 2017 5:04 p.m. To: Artem Shaitarov <ashaita...@nz.imshealth.com>; user@spark.apache.org Subject: RE: Check if dataframe is empty Dataframe.take(1) is faster. From: ashaita...@nz.imshealth.com<mailto:ashaita...@nz.imsh

RE: Check if dataframe is empty

2017-03-06 Thread jasbir.sing
Dataframe.take(1) is faster. From: ashaita...@nz.imshealth.com [mailto:ashaita...@nz.imshealth.com] Sent: Tuesday, March 07, 2017 9:22 AM To: user@spark.apache.org Subject: Check if dataframe is empty Hello! I am pretty sure that I am asking something which has been already asked lots of times

Check if dataframe is empty

2017-03-06 Thread AShaitarov
Hello! I am pretty sure that I am asking something which has been already asked lots of times. However, I cannot find the question in the mailing list archive. The question is - I need to check whether dataframe is empty or not. I receive a dataframe from 3rd party library and this dataframe