sqlglot
sqlglot copied to clipboard
ParseError returned when a MAP() function of a unsupported dialect is used in the SQL
Hi expert, I got a ParseError:
File "C:\Project\AIProjectLangfuse\.venv\Lib\site-packages\sqlglot\parser.py", line 1312, in raise_error
raise error
sqlglot.errors.ParseError: The number of provided arguments (10) is greater than the maximum number of supported arguments (2). Line 2, Col: 67.
SELECT MAP(2, 0, 'Zero', 1, 'One', 2, 'Two', 3, 'Three', 'Default') "map" FROM DUMMY;
Here is the code:
actual_sql = ''' SELECT MAP(2, 0, 'Zero', 1, 'One', 2, 'Two', 3, 'Three', 'Default') "map" FROM DUMMY; ''' res = parse_one(actual_sql)
Actually, the MAP is a function of SAP HANA, which is not a supported dialect type in sqlglot.
So should I implement the new dialect, or is there a better way to solve this problem?