andialbrecht / sqlparse

A non-validating SQL parser module for Python
BSD 3-Clause "New" or "Revised" License
3.71k stars 693 forks source link

added some builtin types in Spark create table statements #689

Closed mrmasterplan closed 1 year ago

mrmasterplan commented 1 year ago

I would like to use this library to parse Spark SQL. Especially I am trying to parse databricks CREATE TABLE and CREATE DATABASE statements. https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-ddl-create-database.html These statements contain some further keywords than the ones already in the library. I created a new section of SPARK_KEYWORDS in the keywords.py file.

Maybe it would also be nice to have an extension mechanism in the library where a user can quickly extend the keyword range without a PR like this. If you like this idea, I will make another PR for it.

mrmasterplan commented 1 year ago

I created this PR from the wrong branch. sorry