[jira] [Assigned] (SPARK-19799) Support WITH clause in subqueries

2019-07-04 Thread Dongjoon Hyun (JIRA)


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

Dongjoon Hyun reassigned SPARK-19799:
-

Assignee: Peter Toth

> Support WITH clause in subqueries
> -
>
> Key: SPARK-19799
> URL: https://issues.apache.org/jira/browse/SPARK-19799
> Project: Spark
>  Issue Type: Sub-task
>  Components: SQL
>Affects Versions: 2.2.0
>Reporter: Giambattista
>Assignee: Peter Toth
>Priority: Major
>
> Because of Spark-17590 it should be relatively easy to support WITH clause in 
> subqueries besides nested CTE definitions.
> Here an example of a query that does not run on spark:
> create table test (seqno int, k string, v int) using parquet;
> insert into TABLE test values (1,'a', 99),(2, 'b', 88),(3, 'a', 77),(4, 'b', 
> 66),(5, 'c', 55),(6, 'a', 44),(7, 'b', 33);
> SELECT percentile(b, 0.5) FROM (WITH mavg AS (SELECT k, AVG(v) OVER 
> (PARTITION BY k ORDER BY seqno ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) as b 
> FROM test ORDER BY seqno) SELECT k, MAX(b) as b  FROM mavg GROUP BY k);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Assigned] (SPARK-19799) Support WITH clause in subqueries

2018-11-03 Thread Apache Spark (JIRA)


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

Apache Spark reassigned SPARK-19799:


Assignee: (was: Apache Spark)

> Support WITH clause in subqueries
> -
>
> Key: SPARK-19799
> URL: https://issues.apache.org/jira/browse/SPARK-19799
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 2.2.0
>Reporter: Giambattista
>Priority: Major
>
> Because of Spark-17590 it should be relatively easy to support WITH clause in 
> subqueries besides nested CTE definitions.
> Here an example of a query that does not run on spark:
> create table test (seqno int, k string, v int) using parquet;
> insert into TABLE test values (1,'a', 99),(2, 'b', 88),(3, 'a', 77),(4, 'b', 
> 66),(5, 'c', 55),(6, 'a', 44),(7, 'b', 33);
> SELECT percentile(b, 0.5) FROM (WITH mavg AS (SELECT k, AVG(v) OVER 
> (PARTITION BY k ORDER BY seqno ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) as b 
> FROM test ORDER BY seqno) SELECT k, MAX(b) as b  FROM mavg GROUP BY k);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Assigned] (SPARK-19799) Support WITH clause in subqueries

2018-11-03 Thread Apache Spark (JIRA)


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

Apache Spark reassigned SPARK-19799:


Assignee: Apache Spark

> Support WITH clause in subqueries
> -
>
> Key: SPARK-19799
> URL: https://issues.apache.org/jira/browse/SPARK-19799
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 2.2.0
>Reporter: Giambattista
>Assignee: Apache Spark
>Priority: Major
>
> Because of Spark-17590 it should be relatively easy to support WITH clause in 
> subqueries besides nested CTE definitions.
> Here an example of a query that does not run on spark:
> create table test (seqno int, k string, v int) using parquet;
> insert into TABLE test values (1,'a', 99),(2, 'b', 88),(3, 'a', 77),(4, 'b', 
> 66),(5, 'c', 55),(6, 'a', 44),(7, 'b', 33);
> SELECT percentile(b, 0.5) FROM (WITH mavg AS (SELECT k, AVG(v) OVER 
> (PARTITION BY k ORDER BY seqno ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) as b 
> FROM test ORDER BY seqno) SELECT k, MAX(b) as b  FROM mavg GROUP BY k);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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