depth of view exceeds the maximum view resolution depth (100).

andrew0117
Contributor

I got this error after updating a view. How can I increase the value of spark.sql.view.maNestedViewDepth to work around this?

Thanks!

Debayan
Databricks Employee
Databricks Employee

Hi, Could you please confirm if you are showing the view? (https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-show-views.html) also, it will be helpful if you post the screenshot of the error.

Thank you!

I found out the root cause for this error is that the view's new definition is trying to join another view which includes a join with this view itself, so it becomes an infinite loop.