sql-formatter-org / sql-formatter

A whitespace formatter for different query languages
https://sql-formatter-org.github.io/sql-formatter/
MIT License
2.32k stars 398 forks source link

[FORMATTING] Unable to parse Hive syntax: STRUCT<x: INT64, y:STRING> #735

Open wupengjiang2024 opened 5 months ago

wupengjiang2024 commented 5 months ago

Input data

Which SQL and options did you provide as input?

STRUCT<x: INT64, y:STRING>

Expected Output

STRUCT<x: INT64, y:STRING>

Actual Output

ERROR: Parse error: Unexpected: STRING

Usage

nene commented 5 months ago

You probably meant something like:

CREATE TABLE foo (
  col1 STRUCT<x: INT64, y:STRING>
)

At least that's how it's documented in Hive documentation.

wupengjiang2024 commented 5 months ago

yes,when I format the SQL like: CREATE TABLE foo ( col1 STRUCT<x: INT64, y:STRING> ) It's will throw the error 'ERROR: Parse error: Unexpected: STRING'

zhongzhifa commented 4 months ago

I'm having this problem too.