Skip to content

spark ddl with struct data type error #900

@MasonMa-sy

Description

@MasonMa-sy

Describe the bug
When I execute show create table a in spark, I get the ddl sql as below:

CREATE TABLE t_a (
a bigint,
b struct <c: bigint>
)

There is a ':' that is optional between field name and field type.

Actual behavior
I input this sql in web demo.

There is a error.

An Unexpected Error Occurred
Parse error: Unexpected ": bigint> " at line 3 column 12. SQL dialect used: "spark".

Please report this at [Github issues page.](https://github.com/sql-formatter-org/sql-formatter/issues)

Stack Trace:

Error: Parse error: Unexpected ": bigint>
" at line 3 column 12.
SQL dialect used: "spark".
    at T.default.createParseError (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:235390)
    at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:235156)
    at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:230135)
    at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:245337)
    at T.default.reset (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:243864)
    at T.O.feed (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:270080)
    at Object.parse (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:245475)
    at T.default.parse (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:16428)
    at T.default.format (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:16326)
    at T.formatDialect (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:264877)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions