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

ASF GitHub Bot updated SPARK-60096:
-----------------------------------
    Labels: pull-request-available  (was: )

> Raise a user-facing error instead of INTERNAL_ERROR for an unresolved Spark 
> Connect DataFrame subquery plan id
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-60096
>                 URL: https://issues.apache.org/jira/browse/SPARK-60096
>             Project: Spark
>          Issue Type: Improvement
>          Components: Connect, SQL
>    Affects Versions: 4.3.0
>            Reporter: Ivan Sadikov
>            Priority: Major
>              Labels: pull-request-available
>
> Spark Connect turns DataFrame subqueries such as `col.isin(df)`, 
> `df.scalar()`, `df.exists()`, and table arguments into `UnresolvedPlanId` 
> expressions (`UnresolvedInSubqueryPlanId`, `UnresolvedScalarSubqueryPlanId`, 
> `UnresolvedExistsPlanId`, `UnresolvedTableArgPlanId`). These expressions 
> point to the subquery plan by plan id. Only 
> `SparkConnectPlanner.transformWithRelations` replaces them with the real 
> plan, and it only does so when the root relation is wrapped in a 
> `WithRelations` that contains the referenced plan.
> If the referenced plan is never attached (for example, the root relation is 
> not wrapped in `WithRelations`), the `UnresolvedPlanId` stays in the tree 
> through analysis. No analyzer rule resolves it, and CheckAnalysis has no 
> specific case for it. It therefore reaches the generic unresolved-operator 
> check and fails with an internal error:
> {code:java}
> [INTERNAL_ERROR] Found the unresolved operator: ... SQLSTATE: XX000 {code}
> This is a resolution error caused by an illegal subquery reference, not a 
> Spark bug. It should be reported the same way as the existing 
> `CANNOT_RESOLVE_DATAFRAME_COLUMN` error, which is raised for an illegal 
> DataFrame column reference.
>  
> Valid queries are not affected. The only change is the error class and 
> SQLSTATE for queries that already fail.



--
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