Describe the bug
When formatting code with MAP keys that have . in them, the formatter adds a space between map name and index.
Expected Output
SELECT
id,
measures_map['bucket.lower'] AS bucket_lower,
SUM(1) as cnt
FROM some.table
GROUP BY
id,
measures_map['bucket.lower']
Actual Output
SELECT
id,
measures_map ['bucket.lower'] AS bucket_lower,
SUM(1) as cnt
FROM some.table
GROUP BY
id,
measures_map ['bucket_lower']
Note: if I cared about measuresmap['somekey'] the formatter behaves perfectly as expected. I have not done an exhaustive search, but I see that `are treated correctly, but.and-` are not.
Usage
How are you calling / using the script? (Please provide a code snippet, if applicable)
I've tried through using Format Document and Format on Save
What SQL language(s) does this apply to?
I'm writing in Presto/Trino and have tried sql, bigquery, spark, and hive and get the same results
Describe the bug When formatting code with MAP keys that have
.
in them, the formatter adds a space between map name and index.Expected Output
Actual Output
Note: if I cared about measuresmap['somekey'] the formatter behaves perfectly as expected. I have not done an exhaustive search, but I see that `
are treated correctly, but
.and
-` are not.Usage
How are you calling / using the script? (Please provide a code snippet, if applicable) I've tried through using
Format Document
andFormat on Save
What SQL language(s) does this apply to? I'm writing in Presto/Trino and have tried
sql
,bigquery
,spark
, andhive
and get the same resultsWhat Node version? (If applicable) v17.9.0