Merging upstream version 17.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
06c5965633
commit
ff2afd7448
91 changed files with 42856 additions and 42624 deletions
|
@ -94,7 +94,11 @@ def parse_one(sql: str, **opts) -> Expression:
|
|||
|
||||
|
||||
def parse_one(
|
||||
sql: str, read: DialectType = None, into: t.Optional[exp.IntoType] = None, **opts
|
||||
sql: str,
|
||||
read: DialectType = None,
|
||||
dialect: DialectType = None,
|
||||
into: t.Optional[exp.IntoType] = None,
|
||||
**opts,
|
||||
) -> Expression:
|
||||
"""
|
||||
Parses the given SQL string and returns a syntax tree for the first parsed SQL statement.
|
||||
|
@ -102,6 +106,7 @@ def parse_one(
|
|||
Args:
|
||||
sql: the SQL code string to parse.
|
||||
read: the SQL dialect to apply during parsing (eg. "spark", "hive", "presto", "mysql").
|
||||
dialect: the SQL dialect (alias for read)
|
||||
into: the SQLGlot Expression to parse into.
|
||||
**opts: other `sqlglot.parser.Parser` options.
|
||||
|
||||
|
@ -109,7 +114,7 @@ def parse_one(
|
|||
The syntax tree for the first parsed statement.
|
||||
"""
|
||||
|
||||
dialect = Dialect.get_or_raise(read)()
|
||||
dialect = Dialect.get_or_raise(read or dialect)()
|
||||
|
||||
if into:
|
||||
result = dialect.parse_into(into, sql, **opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue