Working on Databricks Community Edition

  •  After logging in, the first thing to do is to create a cluster (If a cluster has already been created, proceed to the next step).
    • For cluster creation, click the “Clusters” menu from the side ribbon, or use the “New Cluster” from “Common Tasks”:



  • Enter the cluster name and keep the rest of the settings as it is , for now, and click “Create Cluster”. This will create the cluster and spin it up. Starting a cluster can take some time, so be patient.


  •            The next step is to create a notebook where the magic happens.   For this, Go to Workspace > YourUsername > Create (From the Drop-down menu) > Notebook.



  • Give the notebook a name, select the default language (Don’t worry, any of the four languages can be used inside the notebook regardless of the default language), and choose the newly created cluster:



  • Once that’s done, it’ll look something like this (Default Notebook theme can be Light, can be changed from View):


  •      On top right hand, make sure the cluster is attached to the notebook. (In above step, it is Detached)
  •           Now, %python, %scala, %sql, %r can be used in different cell blocks to run the commands from those languages:



Note: Variables from one cell can be shared with others, but variables can’t be shared directly between two different languages.

  • Once we are done with our task, it is a good practice to terminate the cluster (The Square icon): 


Comments

Popular posts from this blog

Reading a file into a dataframe using PySpark in Databricks

Creating tables from dataframes