Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
westf
Regular Visitor

Load Parquet File into Fabric Datawarehouse

Hello,

Im writting a Fabric notebook to load a Parquet file into Fabric Warehouse.

I want this isn Pysparks only as the notebook is fully written using the PySparks. Please advise me the fast & efficient way to load the data into Warehouse from lakehouse.

My request is, If table exist, i want to upsert, if not, i want to create a table and insert the data.

Please kindly share code

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @westf,

Perhaps you can take a look at the following link to use notebook load data to data warehouse.

Load data to MS Fabric Warehouse from notebook - Stack Overflow

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @westf,

Perhaps you can take a look at the following link to use notebook load data to data warehouse.

Load data to MS Fabric Warehouse from notebook - Stack Overflow

Regards,

Xiaoxin Sheng

NandanHegde
Super User
Super User

Note: you can use Spark SQL for upsert 
What I meant is I am not sure myself whether it is doable via pyspark




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
NandanHegde
Super User
Super User

Below is the sample code that we use :

 

# Load the Parquet file into a Spark DataFrame

df = spark.read.parquet("path/to/your/parquet/file")

# Write the DataFrame to the Fabric Data Warehouse df.write.mode("overwrite").saveAsTable("your_table_name")

 

Now based on what I know, you can either append or overwrite data in table directly.

I am not sure w.r.t upsert, need to validate myself




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.