You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Johnny Bai (Jira)" <ji...@apache.org> on 2020/09/08 10:18:00 UTC
[jira] [Updated] (SPARK-32821) cannot group by with window in sql
sentence for structured streaming with watermark
[ https://issues.apache.org/jira/browse/SPARK-32821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johnny Bai updated SPARK-32821:
-------------------------------
Description:
<pre>
{{{{import spark.implicits._}}}}
{{{{val words = ... // streaming DataFrame of schema \{ timestamp: Timestamp, word: String }}}}}
{{{{// Group the data by window and word and compute the count of each group}}}}
{{{{val windowedCounts = words.groupBy(window($"timestamp", "10 minutes", "5 minutes"),$"word").count()}}}}
{{but not support group by with window in sql style as below:}}
{{"select ts_field,count(*) over window(ts_field, '1 minute', '1 minute') with watermark 1 minute from tableX group by ts_field"}}
</pre>
was:
{{import spark.implicits._}}
{{val words = ... // streaming DataFrame of schema \{ timestamp: Timestamp, word: String }}}
{{// Group the data by window and word and compute the count of each group}}
{{val windowedCounts = words.groupBy(window($"timestamp", "10 minutes", "5 minutes"),$"word").count()}}
{{}}
{{but not support group by with window in sql style as below:}}
{{"select ts_field,count(*) over window(ts_field, '1 minute', '1 minute') with watermark 1 minute from tableX group by ts_field"}}
{{}}
> cannot group by with window in sql sentence for structured streaming with watermark
> -----------------------------------------------------------------------------------
>
> Key: SPARK-32821
> URL: https://issues.apache.org/jira/browse/SPARK-32821
> Project: Spark
> Issue Type: Improvement
> Components: Structured Streaming
> Affects Versions: 3.0.0
> Reporter: Johnny Bai
> Priority: Major
> Fix For: 3.0.1
>
>
> <pre>
>
> {{{{import spark.implicits._}}}}
> {{{{val words = ... // streaming DataFrame of schema \{ timestamp: Timestamp, word: String }}}}}
> {{{{// Group the data by window and word and compute the count of each group}}}}
> {{{{val windowedCounts = words.groupBy(window($"timestamp", "10 minutes", "5 minutes"),$"word").count()}}}}
>
> {{but not support group by with window in sql style as below:}}
> {{"select ts_field,count(*) over window(ts_field, '1 minute', '1 minute') with watermark 1 minute from tableX group by ts_field"}}
> </pre>
--
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