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: Boolean = true
--
Thanks
Dee
as below:
> df.rdd.isEmpty
>
>
> On Tue, Mar 7, 2017 at 9:33 AM, wrote:
>
> 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
> *Sub
t; *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, I cannot find the question in the
...@accenture.com [mailto:jasbir.s...@accenture.com]
Sent: Tuesday, 7 March 2017 5:04 p.m.
To: Artem Shaitarov ; user@spark.apache.org
Subject: RE: Check if dataframe is empty
Dataframe.take(1) is faster.
From: ashaita...@nz.imshealth.com<mailto:ashaita...@nz.imshealth.com>
[mailto:a
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
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 ca