Merging upstream version 23.16.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d0f42f708a
commit
213191b8e3
93 changed files with 64106 additions and 59061 deletions
|
@ -1445,6 +1445,14 @@ class Pragma(Expression):
|
|||
pass
|
||||
|
||||
|
||||
class Declare(Expression):
|
||||
arg_types = {"expressions": True}
|
||||
|
||||
|
||||
class DeclareItem(Expression):
|
||||
arg_types = {"this": True, "kind": True, "default": False}
|
||||
|
||||
|
||||
class Set(Expression):
|
||||
arg_types = {"expressions": False, "unset": False, "tag": False}
|
||||
|
||||
|
@ -1520,6 +1528,10 @@ class CTE(DerivedTable):
|
|||
}
|
||||
|
||||
|
||||
class ProjectionDef(Expression):
|
||||
arg_types = {"this": True, "expression": True}
|
||||
|
||||
|
||||
class TableAlias(Expression):
|
||||
arg_types = {"this": False, "columns": False}
|
||||
|
||||
|
@ -1623,6 +1635,29 @@ class AlterColumn(Expression):
|
|||
}
|
||||
|
||||
|
||||
# https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html
|
||||
class AlterDistStyle(Expression):
|
||||
pass
|
||||
|
||||
|
||||
class AlterSortKey(Expression):
|
||||
arg_types = {"this": False, "expressions": False, "compound": False}
|
||||
|
||||
|
||||
class AlterSet(Expression):
|
||||
arg_types = {
|
||||
"expressions": False,
|
||||
"option": False,
|
||||
"tablespace": False,
|
||||
"access_method": False,
|
||||
"file_format": False,
|
||||
"copy_options": False,
|
||||
"tag": False,
|
||||
"location": False,
|
||||
"serde": False,
|
||||
}
|
||||
|
||||
|
||||
class RenameColumn(Expression):
|
||||
arg_types = {"this": True, "to": True, "exists": False}
|
||||
|
||||
|
@ -1939,6 +1974,7 @@ class Drop(Expression):
|
|||
"cascade": False,
|
||||
"constraints": False,
|
||||
"purge": False,
|
||||
"cluster": False,
|
||||
}
|
||||
|
||||
|
||||
|
@ -2177,6 +2213,11 @@ class PartitionRange(Expression):
|
|||
arg_types = {"this": True, "expression": True}
|
||||
|
||||
|
||||
# https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
|
||||
class PartitionId(Expression):
|
||||
pass
|
||||
|
||||
|
||||
class Fetch(Expression):
|
||||
arg_types = {
|
||||
"direction": False,
|
||||
|
@ -2422,6 +2463,10 @@ class Property(Expression):
|
|||
arg_types = {"this": True, "value": True}
|
||||
|
||||
|
||||
class AllowedValuesProperty(Expression):
|
||||
arg_types = {"expressions": True}
|
||||
|
||||
|
||||
class AlgorithmProperty(Property):
|
||||
arg_types = {"this": True}
|
||||
|
||||
|
@ -2475,6 +2520,10 @@ class DataBlocksizeProperty(Property):
|
|||
}
|
||||
|
||||
|
||||
class DataDeletionProperty(Property):
|
||||
arg_types = {"on": True, "filter_col": False, "retention_period": False}
|
||||
|
||||
|
||||
class DefinerProperty(Property):
|
||||
arg_types = {"this": True}
|
||||
|
||||
|
@ -2651,7 +2700,11 @@ class RemoteWithConnectionModelProperty(Property):
|
|||
|
||||
|
||||
class ReturnsProperty(Property):
|
||||
arg_types = {"this": True, "is_table": False, "table": False}
|
||||
arg_types = {"this": False, "is_table": False, "table": False, "null": False}
|
||||
|
||||
|
||||
class StrictProperty(Property):
|
||||
arg_types = {}
|
||||
|
||||
|
||||
class RowFormatProperty(Property):
|
||||
|
@ -2697,7 +2750,7 @@ class SchemaCommentProperty(Property):
|
|||
|
||||
|
||||
class SerdeProperties(Property):
|
||||
arg_types = {"expressions": True}
|
||||
arg_types = {"expressions": True, "with": False}
|
||||
|
||||
|
||||
class SetProperty(Property):
|
||||
|
@ -2766,8 +2819,13 @@ class WithJournalTableProperty(Property):
|
|||
|
||||
|
||||
class WithSystemVersioningProperty(Property):
|
||||
# this -> history table name, expression -> data consistency check
|
||||
arg_types = {"this": False, "expression": False}
|
||||
arg_types = {
|
||||
"on": False,
|
||||
"this": False,
|
||||
"data_consistency": False,
|
||||
"retention_period": False,
|
||||
"with": True,
|
||||
}
|
||||
|
||||
|
||||
class Properties(Expression):
|
||||
|
@ -3801,7 +3859,7 @@ class Where(Expression):
|
|||
|
||||
|
||||
class Star(Expression):
|
||||
arg_types = {"except": False, "replace": False}
|
||||
arg_types = {"except": False, "replace": False, "rename": False}
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
@ -4175,6 +4233,7 @@ class AlterTable(Expression):
|
|||
"exists": False,
|
||||
"only": False,
|
||||
"options": False,
|
||||
"cluster": False,
|
||||
}
|
||||
|
||||
|
||||
|
@ -4186,6 +4245,11 @@ class DropPartition(Expression):
|
|||
arg_types = {"expressions": True, "exists": False}
|
||||
|
||||
|
||||
# https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#replace-partition
|
||||
class ReplacePartition(Expression):
|
||||
arg_types = {"expression": True, "source": True}
|
||||
|
||||
|
||||
# Binary expressions like (ADD a b)
|
||||
class Binary(Condition):
|
||||
arg_types = {"this": True, "expression": True}
|
||||
|
@ -4738,6 +4802,11 @@ class ArrayConcat(Func):
|
|||
is_var_len_args = True
|
||||
|
||||
|
||||
class ArrayConstructCompact(Func):
|
||||
arg_types = {"expressions": True}
|
||||
is_var_len_args = True
|
||||
|
||||
|
||||
class ArrayContains(Binary, Func):
|
||||
pass
|
||||
|
||||
|
@ -5172,6 +5241,10 @@ class Hex(Func):
|
|||
pass
|
||||
|
||||
|
||||
class LowerHex(Hex):
|
||||
pass
|
||||
|
||||
|
||||
class Xor(Connector, Func):
|
||||
arg_types = {"this": False, "expression": False, "expressions": False}
|
||||
|
||||
|
@ -5902,6 +5975,12 @@ class NextValueFor(Func):
|
|||
arg_types = {"this": True, "order": False}
|
||||
|
||||
|
||||
# Refers to a trailing semi-colon. This is only used to preserve trailing comments
|
||||
# select 1; -- my comment
|
||||
class Semicolon(Expression):
|
||||
arg_types = {}
|
||||
|
||||
|
||||
def _norm_arg(arg):
|
||||
return arg.lower() if type(arg) is str else arg
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue