Returning result from azure databricks to azure datafacotry

Karpagam Gurumurthy 41 Reputation points
2022-02-08T00:48:57.58+00:00

I am new to using Azure Databricks and ADF.

I have a table in azure databricks. I would like to run a select query on this table and return the result of my select query to ADF. When I searched on how this can be done, I see we can use dbutils.notebook.exit() for returning the output. Will it work if I write

dbutils.notebook.exit(spark.sql('select * from Invoice').toJSON().collect())

Is there a limitation on how much data can be returned back?

If this is not the best way to do it, can someone please provide some suggestions on how I can get the result of the query as I need to pass this dataset to an azure function for further processing?

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,338 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,426 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,916 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,528 questions
0 comments No comments
{count} votes

Accepted answer
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2022-02-08T22:11:03.413+00:00

    Hello @Karpagam Gurumurthy ,
    Thanks for the ask and using Microsoft Q&A platform .
    As we understand the ask here is how to result from azure databricks to azure datafactory . Please do let me know if that not accurate
    The better approach will be write the table content to a cloud storage and then read the same from ADF .
    Steps :

    1. Call a notebook from ADF , which reads the table & writes to a blob on clod storage
    2. Add a lookup activity in ADF and read the same blob .

    Please do let me if you have any queries .
    Thanks
    Himanshu

    -------------------------------------------------------------------------------------------------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful