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

Dongjoon Hyun resolved SPARK-52762.
-----------------------------------
    Fix Version/s: 4.1.0
       Resolution: Fixed

> Support analysis inside Declarative Pipelines query functions
> -------------------------------------------------------------
>
>                 Key: SPARK-52762
>                 URL: https://issues.apache.org/jira/browse/SPARK-52762
>             Project: Spark
>          Issue Type: Improvement
>          Components: Declarative Pipelines
>    Affects Versions: 4.1.0
>            Reporter: Sandy Ryza
>            Assignee: Jonathan Chang
>            Priority: Major
>             Fix For: 4.1.0
>
>
> There are some situations where we can't resolve the relation immediately at 
> the time we're registering a flow, and we need to instead communicate the 
> reason and then send it later.
>  
> E.g. consider this situation:
> file 1:
> ```python
> @materialized_view
> def mv1():
>     data = [("Alice", 10), ("Bob", 15), ("Alice", 5)]
>     return spark.createDataFrame(data, ["name", "amount"])
> ```
>  
> file 2:
> ```python
> @materialized_view
> def mv2():
>     return 
> spark.table("mv1").groupBy("name").agg(sum("amount").alias("total_amount"))
> ```
>  
> Unlike some other transformations, which get analyzed lazily, `groupBy` can 
> trigger an `AnalyzePlan` Spark Connect request immediately. If the query 
> function for mv2 gets executed before mv1, then it will hit an error, because 
> mv1 doesn't exist yet.
>  
> We can should retry it after mv1 has executed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to