Hello @shivkumar , I hope this message finds you well.
I didn't fully understand your question, but to write a DataFrame you can follow the steps in the link below:
https://docs.databricks.com/en/getting-started/dataframes.html#tutorial-load-and-transform-data-usin...
In addition to that, please find the ebook "Learning Spark 2nd Edition" where you can see some chapters related to the DataFrame API "Chapter 3. Apache Sparkโs Structured APIs": https://pages.databricks.com/202003-US-EB-Learning-Spark-2nd-Edition_01_Downloadpage.html
Please let me know if you have further questions or concerns.
Best regards,
Lucas Rocha
Technical Solutions Engineer