Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Solved! Go to Solution.
Hi @JoeCrozier ,
Thanks for using Fabric Community.
Unfortunately I am unable to find any way to save a dataframe as table using spark R even after searching every where in google. I am not sure whether we can do this directly or not.
But I found an alternative way inorder to avoid manual step, you can use below code snippet in pyspark to load the files from csv to table in lakehouse.
Code Snippet -
df = spark.read.format("csv").option("header","true").load("Files/year/month/date/sales.csv")
# df now is a Spark DataFrame containing CSV data from "Files/year/month/date/sales.csv".
display(df)
df.write.format("delta").save("Tables/actual_weather")
Above code can be executed along with your existing code, but make sure that above code is written in pyspark not in spark R.
Hope this is helpful. Please let me know incase of further queries.
Hi @JoeCrozier ,
Thanks for using Fabric Community.
Unfortunately I am unable to find any way to save a dataframe as table using spark R even after searching every where in google. I am not sure whether we can do this directly or not.
But I found an alternative way inorder to avoid manual step, you can use below code snippet in pyspark to load the files from csv to table in lakehouse.
Code Snippet -
df = spark.read.format("csv").option("header","true").load("Files/year/month/date/sales.csv")
# df now is a Spark DataFrame containing CSV data from "Files/year/month/date/sales.csv".
display(df)
df.write.format("delta").save("Tables/actual_weather")
Above code can be executed along with your existing code, but make sure that above code is written in pyspark not in spark R.
Hope this is helpful. Please let me know incase of further queries.
Thank you. Yea I posted this on reddit as well and got the same answer. He seemed to suggest "you can do all this in R" but then didnt know specifics and said to use python anyway.
Glad to know your query got resolved. Please continue using Fabric Community for your further queries.
User | Count |
---|---|
81 | |
45 | |
16 | |
11 | |
7 |
User | Count |
---|---|
92 | |
88 | |
27 | |
8 | |
8 |