You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> import sqlglot; sqlglot.transpile("CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()", read="clickhouse", write="clickhouse", pretty=True, error_level=sqlglot.ErrorLevel("IMMEDIATE"))
['CREATE TABLE t (\n i UInt8\n)\nENGINE=AggregatingMergeTree()\nORDER BY tuple()']
>>> import sqlglot; sqlglot.transpile("CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()", read="clickhouse", write="clickhouse", pretty=True, error_level=sqlglot.ErrorLevel("RAISE"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kit/git/sqlglot/sqlglot/__init__.py", line 195, in transpile
for expression in parse(sql, read, error_level=error_level)
File "/home/kit/git/sqlglot/sqlglot/__init__.py", line 83, in parse
return dialect.parse(sql, **opts)
File "/home/kit/git/sqlglot/sqlglot/dialects/dialect.py", line 174, in parse
return self.parser(**opts).parse(self.tokenize(sql), sql)
File "/home/kit/git/sqlglot/sqlglot/parser.py", line 823, in parse
return self._parse(
File "/home/kit/git/sqlglot/sqlglot/parser.py", line 891, in _parse
self.check_errors()
File "/home/kit/git/sqlglot/sqlglot/parser.py", line 903, in check_errors
raise ParseError(
sqlglot.errors.ParseError: Expecting ). Line 1, Col: 17.
CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()
Required keyword: 'this' missing for <class 'sqlglot.expressions.Subquery'>. Line 1, Col: 23.
CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()
Expecting ). Line 1, Col: 17.
CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()
... and 2 more
>>> import sqlglot; sqlglot.transpile("CREATE TABLE t (i UInt8) ENGINE = AggregatingMergeTree() ORDER BY tuple()", read="clickhouse", write="clickhouse", pretty=True, error_level=sqlglot.ErrorLevel("IGNORE"))
['CREATE TABLE t AS\n(\n \n)']
Version: 14.1.1
Looks like when the error level changes read and write become None...
The text was updated successfully, but these errors were encountered:
Version: 14.1.1
Looks like when the error level changes
read
andwrite
becomeNone
...The text was updated successfully, but these errors were encountered: