Forum Discussion
Fabric - Moving Data in Medallion Architecure between Workspaces
Hi,
I am trying to load and transform data from the Lakehouse in the Silver Layer Workspace to a Warehouse in the Gold Layer Workspace. However, I only seem to be able to use a Gen2 Dataflow for this. I cannot use a Pipeline Copy Data Activity, and I cannot seem to figure out how to use an SQL query in the Warehouse to load and transform the data using either the ABFS delta table path or DB name. I also tried writing the data into the Warehouse using the Lakehouse Notebook, but I get a PUT operation error. Any idea how to load and transform the data from a Silver Layer Lakehouse Workspace to a Gold Layer Warehouse Workspace without using a dataflow? Reasoning: In the dataflow I only have append or replace. I cannot make operations that perform a duplicates test before loading.
Thanks
4 Replies
- bcdobbs
Community Champion
Struggling to find it now but cross workspace data copy in a pipeline is not yet supported. (Sure it is on the roadmap).
Shortcut I think is an option.Can you share the notebook code that is throwing the error?
- Poweraegg
Advocate IV
from delta.tables import *from pyspark.sql.types import *from pyspark.sql.functions import *# Define the pathsilver_path = "abfss://[email protected]/Contoso_Silver_LH.Lakehouse/Files/Product_Silver_External"gold_path = "abfss://[email protected]/WH_Contoso_Gold.Datawarehouse/Tables/dbo/Products_Gold"# Read the Delta tabledeltaTable = DeltaTable.forPath(spark, silver_path)# Convert the Delta table to a DataFramedf_silver = deltaTable.toDF()# Cast the 'Unit_Cost' and 'Unit_Price' columns to match the types in the Gold Warehouse tabledf_silver = df_silver.withColumn("Unit_Cost", col("Unit_Cost").cast(DecimalType(18,0)))df_silver = df_silver.withColumn("Unit_Price", col("Unit_Price").cast(DecimalType(18,0)))# Write the data to the Gold Warehousedf_silver.write.format("delta").mode("overwrite").save(gold_path)Output -ERROR: Caused by: Operation failed: "Bad Request", 400, PUT, http://onelake.dfs.fabric.microsoft.com/Contoso_Gold/WH_Contoso_Gold.Datawarehouse/Tables/dbo/Products_Gold/part-00000-3c5b3f4d-a440-46f3-9649-eea4c5e22693-c000.snappy.parquet?resource=file&timeout=90, OperationNotAllowedOnThePath, "PUT call is not allowed on Tables path"- bcdobbs
Community Champion
I think the issue is you can only write to warehouse tables through the sql end point. I'll have a play and get back to you.
- AnonymousNot applicable
I faced same issue while doing a merge query to warehouse table path from silver to gold using notebook. Is there a solution for this? Kindly provide if any.