Forum Discussion

bennoss's avatar
bennoss
Regular Visitor
1 year ago

Lakehouse Schema Error

Hi all, 

 

I have a lakehouse in which I enabled the schema preview and in doing so I created a 'raw' schema to try and setup some medallion architecture, however when do my organisation I ended up with a batch of tables in the raw schema and the same batch outside of it in the regular 'dbo' schema.

 

I would prefer to just delete the raw schema, but there doesnt seem to be a way to do this as sql endpoint is read only and notebooks dont accept the schema format 

 

eg.

 

spark.sql("DROP TABLE IF EXISTS (lakehousename).raw.tablename")

 

AnalysisException: [REQUIRES_SINGLE_PART_NAMESPACE] spark_catalog requires a single-part namespace, but got `(lakehousename)`.`raw`.

any ideas?

 

3 Replies

  • Hi bennoss, could you first try to refresh the lakehouse and see if the tables appear then? If you see the schema you could delete the schema and all underlying items at once in the lakehouse viewer.

     

    However, if that remains invisible, could you attach the lakehouse to the notebook you are using to exectute the sql script and try again with the lakehouse attached? This error was also mentioned here: https://community.fabric.microsoft.com/t5/Data-Engineering/Cannot-Cross-workspace-Spark-SQL-queries-in-Microsoft-Fabric/m-p/4169679#M4228 and was solved this way.

  • bennoss's avatar
    bennoss
    Regular Visitor

    sorry forgot to also mention I cant find the tables in my onelake directory or within the lakehouse, however they appear when using dataflows and within the sql endpoint connection

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi bennoss 

       

      Have you tried FabianSchut 's suggestions?

       

      Additionally, how did you load a batch of tables in the raw schema? At that time, could you see them in the lakehouse Explorer? If you switch the lakehouse to SQL analytics endpoint view, can you see the "raw" schema now? 

       

      Best Regards,
      Jing