spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reynold Xin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-1914) Simplify CountFunction not to traverse to evaluate all child expressions.
Date Tue, 27 May 2014 22:00:02 GMT

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

Reynold Xin updated SPARK-1914:
-------------------------------

    Fix Version/s:     (was: 1.0.0)
                   1.0.1

> Simplify CountFunction not to traverse to evaluate all child expressions.
> -------------------------------------------------------------------------
>
>                 Key: SPARK-1914
>                 URL: https://issues.apache.org/jira/browse/SPARK-1914
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Takuya Ueshin
>            Assignee: Takuya Ueshin
>             Fix For: 1.0.1
>
>
> {{CountFunction}} should count up only if the child's evaluated value is not null.
> Because it traverses to evaluate all child expressions, even if the child is null, it
counts up if one of the all children is not null.
> To reproduce this bug in {{sbt hive/console}}:
> {code}
> scala> hql("SELECT COUNT(*) FROM src1").collect()
> res1: Array[org.apache.spark.sql.Row] = Array([25])
> scala> hql("SELECT COUNT(*) FROM src1 WHERE key IS NULL").collect()
> res2: Array[org.apache.spark.sql.Row] = Array([10])
> scala> hql("SELECT COUNT(key + 1) FROM src1").collect()
> res3: Array[org.apache.spark.sql.Row] = Array([25])
> {code}
> {{res3}} should be 15 since there are 10 null keys.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message