[ 
https://issues.apache.org/jira/browse/SPARK-37500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453215#comment-17453215
 ] 

Rui Wang commented on SPARK-37500:
----------------------------------

I can take a look on this bug.

> Incorrect scope when using named_windows in CTEs
> ------------------------------------------------
>
>                 Key: SPARK-37500
>                 URL: https://issues.apache.org/jira/browse/SPARK-37500
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.1.2, 3.2.0
>         Environment: Databricks Runtime 9.0, 9.1, 10.0
>            Reporter: Lauri Koobas
>            Priority: Major
>
> This works, but shouldn't. The named_window is described outside the CTE that 
> uses it.
> {code:sql}
> with step_1 as (
>   select *
>   , min(a) over w1 as min_a_over_w1
>   from (select 1 as a, 2 as b, 3 as c)
> )
> select *
> from step_1
> window w1 as (partition by b order by c)
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to