I am trying to count the missing values of a particular coulmn in the DataFrame in Sparklyr like below
count(filter(subdata, isNull(subdata$metric)))
Source: query [1 x 1]
Database: spark connection master=local[4] app=sparklyr local=TRUE
n
<dbl>
1 216360``
But the result returned is the total number of rows in the dataframe. Am I missing something. Kindly Point it out.
The following function will count the number of
NA
values for a given column usingsparklyr
:Note -
df
should be of class"tbl_spark" "tbl_sql" "tbl_lazy" "tbl"
; e.g.df <- tbl(sc, <table>)