How to read a string value in spark with Python?

john josef's picture
john josef asked on December 16, 2020 - 1:41am | Replies (0).

I am using Azure Databricks with Blob Storage. In my Python Notebook, I wanted to read a raw string using spark.read(). I dont know how to read a string with this methodology, if not this then is there any other way by which I can read a string value directly using spark. Because then I need to write that particular string in a text file using df.write.format("text").save([path]).

Currently I am only able to read contents from a file using spark.read.text([path of file]). So, instead of reading from file I directly wanted to pass a string value.

No answers yet.

StickyMinds is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.