Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

How to create a Materialized View in Lakehouse? not in KQL Database

I have below code and want to create a Materialized View for it: spark.sql("SELECT * FROM ParquetRainfallTable WHERE month == 'Apr' AND  \           location = 'Clementi Road' ORDER BY rainfall de...
  • nilendraFabric's avatar
    1 year ago

    Hello Anonymous 

     

    the Spark SQL engine in Fabric Lakehouse does not recognize the materialized view syntax. In Microsoft Fabric, while materialized views exist, they are not created using the standard Spark SQL statement. Instead, materialized views in Fabric are designed to be created through a KQL-based interface


    in kusto query: 

    .create materialized-view [ifnotexists] <ViewName> on table <SourceTable>
    {
    // Your summarize-based aggregation query here
    }

     

    use %kusto magic command 

     

    if this is helpful please accept the solution