You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Takeshi Yamamuro (Jira)" <ji...@apache.org> on 2019/11/01 05:22:00 UTC
[jira] [Updated] (SPARK-29701) Different answers when empty input
given in GROUPING SETS
[ https://issues.apache.org/jira/browse/SPARK-29701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Takeshi Yamamuro updated SPARK-29701:
-------------------------------------
Description:
A query below with an empty input seems to have different answers between PgSQL and Spark;
{code:java}
postgres=# create table gstest_empty (a integer, b integer, v integer);
CREATE TABLE
postgres=# select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),());
a | b | sum | count
---+---+-----+-------
| | | 0
(1 row)
{code}
{code:java}
scala> sql("""select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),())""").show
+---+---+------+--------+
| a| b|sum(v)|count(1)|
+---+---+------+--------+
+---+---+------+--------+
{code}
was:
{code:java}
A query below with an empty input seems to have different answers between PgSQL and Spark;
postgres=# create table gstest_empty (a integer, b integer, v integer);
CREATE TABLE
postgres=# select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),());
a | b | sum | count
---+---+-----+-------
| | | 0
(1 row)
{code}
{code:java}
scala> sql("""select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),())""").show
+---+---+------+--------+
| a| b|sum(v)|count(1)|
+---+---+------+--------+
+---+---+------+--------+
{code}
> Different answers when empty input given in GROUPING SETS
> ---------------------------------------------------------
>
> Key: SPARK-29701
> URL: https://issues.apache.org/jira/browse/SPARK-29701
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 3.0.0
> Reporter: Takeshi Yamamuro
> Priority: Major
>
> A query below with an empty input seems to have different answers between PgSQL and Spark;
> {code:java}
> postgres=# create table gstest_empty (a integer, b integer, v integer);
> CREATE TABLE
> postgres=# select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),());
> a | b | sum | count
> ---+---+-----+-------
> | | | 0
> (1 row)
> {code}
> {code:java}
> scala> sql("""select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),())""").show
> +---+---+------+--------+
> | a| b|sum(v)|count(1)|
> +---+---+------+--------+
> +---+---+------+--------+
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org