SELECT * from dbfs:/FileStore/shared_uploads/prasanth/Company.csv
I am trying to select the records from folder in azure data bricks but I am facing this
Error
SQL statement: AnalysisException: Table or view not found
SELECT * from dbfs:/FileStore/shared_uploads/prasanth/Company.csv
I am trying to select the records from folder in azure data bricks but I am facing this
Error
SQL statement: AnalysisException: Table or view not found
2
Answers
Try it this way.
I reproduced this got same error.
This error occurs when there is no table or view created earlier on that name in databricks SQL.
In the above, you are trying to query
dbfs:/filepath.csv
which is not a table or view in Databricks SQL.To access
dbfs
file in databricks SQL, first we need to create a table or view for that and copy the csv file data into that. Then we can query that table.Code for that:
My Execution:
Another alternative(to query csv in databricks SQL) for this can be using pyspark or scala dataframe as suggested by @ASH above.
Read the csv file then create a temporary view.
Code:
Output for your reference: