Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Spark Tables CREATE OR REPLACE not working

When running this code 

 
%%sql
CREATE OR REPLACE TABLE sample (
    integer INT,
    string VARCHAR(50)
)
 
I get the error message "Error: REPLACE TABLE is only supported with v2 tables." Removing REPLACE fixes the code, however is this functionality that will be added into Fabric later, or is there something that needs to be enabled to allow CREATE OR REPLACE statements? 

2 Replies

  • HimanshuS-msft's avatar
    HimanshuS-msft
    Microsoft Employee

    Hello Anonymous 
    Thanks for using the Fabric community.
    I have a repro and let me reach out to the internal team to get more help on this .


    Error: REPLACE TABLE is only supported with v2 tables. org.apache.spark.sql.errors.QueryCompilationErrors$.operationOnlySupportedWithV2TableError(QueryCompilationErrors.scala:506) org.apache.spark.sql.catalyst.analysis.ResolveSessionCatalog$$anonfun$apply$1.applyOrElse(ResolveSessionCatalog.scala:189)

    Thanks
    HImanshu

  • HimanshuS-msft's avatar
    HimanshuS-msft
    Microsoft Employee

    Hello Anonymous , 

    Currently the  Spark version on Fabric is Spark 3.3 and Spark 3.3 in this  version of Spark we do have the Replace option please see here .

     

    I am aware of that databricks does provide that option at this time .  We request you to please log the ask here https://ideas.fabric.microsoft.com/ .

     

    Thanks 
    Himanshu