Write csv file to Sharepoint from databricks notebook using scala

ak 1 Reputation point
2022-02-08T01:18:00.587+00:00

We want to write csv file in sharepoint using scala from databricks notebook but I haven't found solution online or in community. Is there's a way to do it ? Is it possible from notebook ?If not, is there any alternative way to do it ?

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,514 questions
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Elsie Lu_MSFT 9,801 Reputation points
    2022-02-08T06:58:43.57+00:00

    Hi @ak , welcome to Q&A forum!

    As mentioned in this thread: Reading data from Sharepoint Using Databricks

    Reading data from sharepoint using Azure databricks is not possible. Sharepoint is not supported source in Azure databricks.

    For more details, kindly refer to: Data sources


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. ak 1 Reputation point
    2022-02-10T07:49:17.247+00:00

    There are two way to do it.

    @Elsie Lu_MSFT

    1. We cannot save file in Sharepoint directly though Databricks but We can upload file using Graph API which will support uploading large file.
      I am thinking of creating jar file and call the function through spark scala.

    https://devzigma.com/java/upload-files-to-sharepoint-using-java/

    1. I wrote code in C# to upload large file in sharepoint using Microsoft.SharePoint.Client . I am checking if I can convert it to UDF function and call it from spark.

    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-large-files-sample-app-for-sharepoint
    https://learn.microsoft.com/en-us/dotnet/spark/how-to-guides/udf-guide#:~:text=NET%20for%20Apache%20Spark.,logic%20defined%20in%20the%20UDF.

    I wish we have straight forward solution but it seems possible . Lot of work need to be done to make it work.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.