Skip to main content

Add credentials

  1. Create a new pipeline or open an existing pipeline.
  2. Expand the left side of your screen to view the file browser.
  3. Scroll down and click on a file named io_config.yaml.
  4. Enter the following keys and values under the key named default (you can have multiple profiles, add it under whichever is relevant to you)

Using SQL Block with Databricks

Follow these steps to use a SQL block connected to Databricks in your pipeline.
  1. Create or open a pipeline
    Create a new pipeline or open an existing one.
  2. Add a block
    Add a Data loader, Transformer, Data exporter, or Custom block.
  3. Select block type
    Set the block type to SQL.
  4. Configure the data provider
    In the Data provider dropdown, select Databricks.
  5. Choose a profile
    In the Profile dropdown, select default (or the profile you configured your Databricks credentials under).
  6. Configure output saving (optional)
    By default, the SQL block saves query results to a table in your Databricks database.
    • Schema (optional): Enter the schema where the block’s output should be saved, default to the schema in io_config.yaml.
    • Table (optional): Enter the table where the block’s output should be saved, default table is generated based on block uuid.
    • Write policy: Choose either Replace or Append. See the SQL blocks guide for more details on write policies.
    • If you don’t want to save results to an intermediate table, enable the Use raw SQL option. See the Raw SQL documentation for more information.
  7. Enter a test query
    Add a simple test query to confirm the connection works:
  8. Run the block
    Click Run to execute the query and verify the block works as expected.

Using Python block

  1. Create a new pipeline or open an existing pipeline.
  2. Add a data loader, transformer, or data exporter block (the code snippet below is for a data loader).
  3. Select the Data lakes -> Databricks SQL template or Generic (no template).
  4. Enter this code snippet (note: change the config_profile from default if you have a different profile):
  1. Run the block.

Export a dataframe

Here is an example code snippet to export a dataframe to Databricks:

Method arguments