[Python] How to create a persistent view from a pyspark dataframe

Discussão em 'Python' iniciado por Stack, Abril 15, 2025.

  1. Stack

    Stack Membro Participativo

    I have a pyspark dataframe df, and would like to save it as a persistent view. Is that possible?

    I tried to do the following:

    df.createOrReplaceTempView("temp_view")
    spark.sql('CREATE VIEW my_view AS SELECT * FROM temp_view'))


    And I got the following error message: "Not allowed to create a permanent view my_view by referencing a temporary view temp_view"

    Continue reading...

Compartilhe esta Página