Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-16937

Confusing behaviors when View and Temp View sharing the same names

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:

      Description

              sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE ID < 3")
              sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
              // This returns the contents of the temp view.
              sql(s"select * from $viewName").show(false)
              // This returns the contents of the view.
              sql(s"select * from default.$viewName").show(false)
      
              // Below is to drop the temp view
              sql(s"DROP VIEW $viewName")
              // Both results are non-temp view
              sql(s"select * from $viewName").show(false)
              sql(s"select * from default.$viewName").show(false)
      
              // After another drop, the non-temp view is dropped.
              sql(s"DROP VIEW $viewName")
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              smilegator Xiao Li
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: