Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse MySQL type YEAR(4) #2109

Closed
kszucs opened this issue Aug 23, 2023 · 0 comments
Closed

Unable to parse MySQL type YEAR(4) #2109

kszucs opened this issue Aug 23, 2023 · 0 comments

Comments

@kszucs
Copy link
Contributor

kszucs commented Aug 23, 2023

sg.parse_one("YEAR(4)", into=sge.DataType, read="mysql")

fails with

ParseError: Failed to parse 'YEAR(4)' into <class 'sqlglot.expressions.DataType'>

Would it be possible to ignore the display width for all types when parsing?

Another failing case is:
Failed to parse 'mediumint(20)' into <class 'sqlglot.expressions.DataType'>

while bigint(20) is parsed as

In [6]:  sg.parse_one("bigint(20)", into=sge.DataType, read="mysql")
Out[6]:
(DATATYPE this: Type.BIGINT, expressions:
  (DATATYPEPARAM this:
    (LITERAL this: 20, is_string: False)), nested: False, prefix: False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant