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

Spark native temporary table

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • None

    Description

      Many databases and data warehouse SQL engines support temporary tables. A temporary table, as its named implied, is a short-lived table that its life will be only for current session.

      In Spark, there is no temporary table. the DDL “CREATE TEMPORARY TABLE AS SELECT” will create a temporary view. A temporary view is totally different with a temporary table. 

      A temporary view is just a VIEW. It doesn’t materialize data in storage. So it has below shortage:

      1. View will not give improved performance. Materialize intermediate data in temporary tables for a complex query will accurate queries, especially in an ETL pipeline.
      2. View which calls other views can cause severe performance issues. Even, executing a very complex view may fail in Spark. 
      3. Temporary view has no database namespace. In some complex ETL pipelines or data warehouse applications, without database prefix is not convenient. It needs some tables which only used in current session.

       

      More details are described in Design Docs

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cltlfcjin Lantao Jin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: