1
0
Fork 0

Adding upstream version 18.3.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 20:59:23 +01:00
parent ab14e550ff
commit e0d212c3f9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
56 changed files with 29963 additions and 29170 deletions

View file

@ -45,6 +45,7 @@ class Teradata(Dialect):
"MOD": TokenType.MOD,
"NE": TokenType.NEQ,
"NOT=": TokenType.NEQ,
"SAMPLE": TokenType.TABLE_SAMPLE,
"SEL": TokenType.SELECT,
"ST_GEOMETRY": TokenType.GEOMETRY,
"TOP": TokenType.TOP,
@ -55,6 +56,8 @@ class Teradata(Dialect):
SINGLE_TOKENS.pop("%")
class Parser(parser.Parser):
TABLESAMPLE_CSV = True
CHARSET_TRANSLATORS = {
"GRAPHIC_TO_KANJISJIS",
"GRAPHIC_TO_LATIN",
@ -171,6 +174,11 @@ class Teradata(Dialect):
exp.Use: lambda self, e: f"DATABASE {self.sql(e, 'this')}",
}
def tablesample_sql(
self, expression: exp.TableSample, seed_prefix: str = "SEED", sep=" AS "
) -> str:
return f"{self.sql(expression, 'this')} SAMPLE {self.expressions(expression)}"
def partitionedbyproperty_sql(self, expression: exp.PartitionedByProperty) -> str:
return f"PARTITION BY {self.sql(expression, 'this')}"