linhongliu-db opened a new pull request #35653:
URL: https://github.com/apache/spark/pull/35653


   ### What changes were proposed in this pull request?
   In 3.2, we unified the representation of dataset view and SQL view, i.e., we 
wrap both
   of them with `View`. This causes a regression that below case works in 3.1 
but failed in 3.2
   ```sql
   sql("select 1").createOrReplaceTempView("v")
   sql("select * from v").createOrReplaceTempView("v")
   -- in 3.1 it works well, and select will output 1
   -- in 3.2 it failed with error: "AnalysisException: Recursive view v 
detected (cycle: v -> v)"
   ```
   The root cause is in 3.1 we actually never did view cyclic check for dataset 
view. Because they
   are wrapped by `SubqueryAlias` instead of `View`
   In this, we want to skip the cyclic check if the legacy conf 
`storeAnalyzedPlan` is set. So, we
   can keep the legacy use cases working and not affect the new view behavior.
   
   ### Why are the changes needed?
   fix regression
   
   
   ### Does this PR introduce _any_ user-facing change?
   fix regression
   
   
   ### How was this patch tested?
   newly added ut
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to