Read CSV in Databricks in Spark

Load CSV in Databricks

Databricks Community Edition provides a graphical interface for file loading.

This interface is accessed in the DataBase > Create New Table.

Once inside, the fields must be indicated:

Upload to DBF: name of the file to Load.
Select a cluster to preview the Table: the cluster on which to perform the Operations.

Upload CVS data to Databricks

Upload CVS data to Databricks 2

Read files

Access to the uploaded file can be done through a Spark SQL query

mis_datos = spark.sql("SELECT * FROM datos_csv")
display(mis_datos.select("*"))

Result of a spark SQL query