Skip to content

Support Databricks SQL notebook source file #6222

@klenium

Description

@klenium

Search before asking

  • I searched the issues and found no similar issues.

Description

If we download a notebook that was SQL language as a Source file type, it is a .sql file starting with -- Databricks notebook source and containing -- COMMAND ----------\n\n lines. It can be formatted and re-imported to Databricks.

It is not mandatory in Databricks to put a semicolon at the end of each cells, so the exported content is not a fully valid SQL file. SqlFluff is not able to handle it, and thinks that the cells are one statement, which results in exception.

Use case

SqlFluff should not throw unparsable exceptions. It sould be able to process cells separately, or maybe even add a rule to be able to put semicolon at the end of cells by running the fix command.

Dialect

Databricks

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions