1
0
Fork 0

Adding upstream version 25.0.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:37:28 +01:00
parent dd3422a695
commit 91ffc387a9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
84 changed files with 33016 additions and 31040 deletions

View file

@ -341,7 +341,7 @@ class DuckDB(Dialect):
if self._match(TokenType.L_BRACE, advance=False):
return self.expression(exp.ToMap, this=self._parse_bracket())
args = self._parse_wrapped_csv(self._parse_conjunction)
args = self._parse_wrapped_csv(self._parse_assignment)
return self.expression(exp.Map, keys=seq_get(args, 0), values=seq_get(args, 1))
def _parse_struct_types(self, type_required: bool = False) -> t.Optional[exp.Expression]:
@ -503,11 +503,93 @@ class DuckDB(Dialect):
exp.DataType.Type.VARBINARY: "BLOB",
exp.DataType.Type.ROWVERSION: "BLOB",
exp.DataType.Type.VARCHAR: "TEXT",
exp.DataType.Type.TIMESTAMPNTZ: "TIMESTAMP",
exp.DataType.Type.TIMESTAMP_S: "TIMESTAMP_S",
exp.DataType.Type.TIMESTAMP_MS: "TIMESTAMP_MS",
exp.DataType.Type.TIMESTAMP_NS: "TIMESTAMP_NS",
}
# https://github.com/duckdb/duckdb/blob/ff7f24fd8e3128d94371827523dae85ebaf58713/third_party/libpg_query/grammar/keywords/reserved_keywords.list#L1-L77
RESERVED_KEYWORDS = {
"array",
"analyse",
"union",
"all",
"when",
"in_p",
"default",
"create_p",
"window",
"asymmetric",
"to",
"else",
"localtime",
"from",
"end_p",
"select",
"current_date",
"foreign",
"with",
"grant",
"session_user",
"or",
"except",
"references",
"fetch",
"limit",
"group_p",
"leading",
"into",
"collate",
"offset",
"do",
"then",
"localtimestamp",
"check_p",
"lateral_p",
"current_role",
"where",
"asc_p",
"placing",
"desc_p",
"user",
"unique",
"initially",
"column",
"both",
"some",
"as",
"any",
"only",
"deferrable",
"null_p",
"current_time",
"true_p",
"table",
"case",
"trailing",
"variadic",
"for",
"on",
"distinct",
"false_p",
"not",
"constraint",
"current_timestamp",
"returning",
"primary",
"intersect",
"having",
"analyze",
"current_user",
"and",
"cast",
"symmetric",
"using",
"order",
"current_catalog",
}
UNWRAPPED_INTERVAL_VALUES = (exp.Literal, exp.Paren)
# DuckDB doesn't generally support CREATE TABLE .. properties