You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sasi (JIRA)" <ji...@apache.org> on 2016/01/21 13:23:39 UTC

[jira] [Updated] (SPARK-12741) DataFrame count method return wrong size.

     [ https://issues.apache.org/jira/browse/SPARK-12741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sasi updated SPARK-12741:
-------------------------
    Description: 
Hi,
I'm updating my report.

I'm working with Spark 1.5.2, (used to be 1.5.0), I have a DataFrame and I have 2 method, one for collect data and other for count.

method doQuery looks like:
{code}
subscribersDataFrame.collect()
{code}
method doQueryCount looks like:
{code}
subscribersDataFrame.count()
{code}

I have few scenarios with few results:
1) Non data exists on my NoSQLDatabase results: count 0 and collect() 0
2) 3 rows exists results: count 0 and collect 3.
3) 5 rows exists results: count 2 and collect 5. 

I tried to change the count code to the below code, but got the same results as I mentioned above.
{code}
subscribersDataFrame.sql("select count(*) from tbl").count/collect[0]
{code}


Thanks,
Sasi

  was:
Hi,
I noted that DataFrame count method always return wrong size.
Assume I have 11 records.
When running dataframe.count() I get 9.
Also if I'm running dataframe.collectAsList() then i'll get 9 records instead of 11.
But if I run dataframe.collect() then i'll get 11.

Thanks,
Sasi


> DataFrame count method return wrong size.
> -----------------------------------------
>
>                 Key: SPARK-12741
>                 URL: https://issues.apache.org/jira/browse/SPARK-12741
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.0
>            Reporter: Sasi
>
> Hi,
> I'm updating my report.
> I'm working with Spark 1.5.2, (used to be 1.5.0), I have a DataFrame and I have 2 method, one for collect data and other for count.
> method doQuery looks like:
> {code}
> subscribersDataFrame.collect()
> {code}
> method doQueryCount looks like:
> {code}
> subscribersDataFrame.count()
> {code}
> I have few scenarios with few results:
> 1) Non data exists on my NoSQLDatabase results: count 0 and collect() 0
> 2) 3 rows exists results: count 0 and collect 3.
> 3) 5 rows exists results: count 2 and collect 5. 
> I tried to change the count code to the below code, but got the same results as I mentioned above.
> {code}
> subscribersDataFrame.sql("select count(*) from tbl").count/collect[0]
> {code}
> Thanks,
> Sasi



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org