This should be so basic and obvious that a child could do it, yet I’ve spent several hours trying to figure it out. Every resource I’ve found (and there have been many) says to “Click Data in the left sidebar and then select Add data.” Even Databricks’ own chatbot says this. There is no Data option to click in the left sidebar. It doesn’t exist.
If I go to Catalog –> Create new table, I have to define a table scheme. It seems to be relevant only to tabular data. I have unstructured data in a .txt file.
From a notebook, I can go to File –> Upload data to DBFS…. I then drag and drop my file into the UI, and it seems to upload. It gives me a path to copy: '/dbfs/FileStore/shared_uploads/MY_USERNAME/MY_FILE.txt'
.
But when I try the following code in my notebook, I get an error:
file_path = '/dbfs/FileStore/shared_uploads/MY_USERNAME/MY_FILE.txt'
with open(file_path, 'r') as file:
data = file.read()
FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/FileStore/shared_uploads/MY_USERNAME/MY_FILE.txt'
Why is this so difficult? What am I doing wrong?