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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.