Problem: Error in SQL statement:
AnalysisException: Table or view not found
When you try to query a table or view, you get this error:
AnalysisException:Table or view not found when trying to query a global temp view
You typically create global
temp views so they can be accessed from different sessions and kept alive until the application ends. You can create a global
temp view with the following statement:
df is the
DataFrame. Another way to create the view is with:
CREATE GLOBAL TEMP VIEW <global-view-name>
All global temporary views are tied to a system temporary database named
global_temp. If you query the global table or view without explicitly mentioning the
global_temp database, then the error occurs.
Always use the qualified table name with the
global_temp database, so that you can query the global view data successfully.
%sql select * from global_temp.<global-view-name>;