DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
155 stars 52 forks source link

Insert overwrite with and without partition aren't parsed properly #147

Closed Appalled closed 1 year ago

Appalled commented 1 year ago

Hi, the following queries aren't parsed properly. Please have a look. sparksql syntax reference

insert overwrite data_base_name.tb_name_01 
partition ( key1 = '20230522' ,key2 = 'bb')
SELECT *
  FROM 
data_base_name.tb_name_00
;

insert overwrite data_base_name.tb_name_02
SELECT
  a1.col_a,
  a1.col_b
FROM 
(
  SELECT
    *
  FROM
    data_base_name.tb_name_01 
  WHERE
    key1 >= 'bb'
) a1

two queries: image

just the second query image

matthias-Q commented 1 year ago

Thanks for reporting. Be aware that, after #148 is merged, we need to create a PR for nvim-treesitter to register the keyword overwrite because that is new.

This is the first Spark SQL syntax that we have implemented. There will definitely be more things that are parsed correctly!