You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2022/06/23 05:34:00 UTC
[jira] [Resolved] (SPARK-39548) CreateView Command with a window clause query hit a wrong window definition not found issue
[ https://issues.apache.org/jira/browse/SPARK-39548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-39548.
---------------------------------
Fix Version/s: 3.3.1
3.2.2
3.4.0
Resolution: Fixed
Issue resolved by pull request 36947
[https://github.com/apache/spark/pull/36947]
> CreateView Command with a window clause query hit a wrong window definition not found issue
> -------------------------------------------------------------------------------------------
>
> Key: SPARK-39548
> URL: https://issues.apache.org/jira/browse/SPARK-39548
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.3.0
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Fix For: 3.3.1, 3.2.2, 3.4.0
>
>
> This query will hit a w2 window definition not found in `WindowSubstitute` rule, however this is a bug since the w2 definition is defined in the query.
> ```
> create or replace temporary view test_temp_view as
> with step_1 as (
> select * , min(a) over w2 as min_a_over_w2 from (select 1 as a, 2 as b, 3 as c) window w2 as (partition by b order by c)) , step_2 as
> (
> select *, max(e) over w1 as max_a_over_w1
> from (select 1 as e, 2 as f, 3 as g)
> join step_1 on true
> window w1 as (partition by f order by g)
> )
> select *
> from step_2
> ```
> Also we can move the unresolved window expression check from `WindowSubstitute` rule to `CheckAnalysis` phrase.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org