view in dataframe

Vineet S 325 Reputation points


how we can create or replace view statement in spark sql in dataframe of databricks

create or replace view as

(select * from temp1)

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,057 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,066 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Azar 21,485 Reputation points MVP

    Hi there Vineet S

    create a DataFrame by reading from a source eg csv file etc

    Use the createOrReplaceTempView method to create or replace the view

     Create a DataFrame
    df ="path/to/csv/file")
    Create or replace the view

    he DataFrame df is created by reading a CSV file. The createOrReplaceTempView method is then used to create or replace a temporary view named "temp1_view"

    If this helps kindly accept the answer thanks much.,