You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2025/11/09 20:42:00 UTC

[jira] [Commented] (SPARK-52762) Support analysis inside Declarative Pipelines query functions

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

Dongjoon Hyun commented on SPARK-52762:
---------------------------------------

I added SPARK-51727 link instead of Apache Spark 4.1.0 JIRA issue link because this feature depends on the SPARK-51727 . If we cannot deliver SPARK-51727 in Apache Spark 4.1.0 timeline, we also cannot say that we deliver this, [~sandyr]

> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org