summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/duckdb.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
commit5b1ac5070c43c40a2b5bbc991198b0dddf45dc75 (patch)
treeed329138d5e8e5c9d5164b5c853d6f40a116f4d6 /sqlglot/dialects/duckdb.py
parentReleasing debian version 11.3.0-1. (diff)
downloadsqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.tar.xz
sqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.zip
Merging upstream version 11.3.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/duckdb.py')
-rw-r--r--sqlglot/dialects/duckdb.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sqlglot/dialects/duckdb.py b/sqlglot/dialects/duckdb.py
index c2755cd..db79d86 100644
--- a/sqlglot/dialects/duckdb.py
+++ b/sqlglot/dialects/duckdb.py
@@ -11,7 +11,6 @@ from sqlglot.dialects.dialect import (
no_pivot_sql,
no_properties_sql,
no_safe_divide_sql,
- no_tablesample_sql,
rename_func,
str_position_sql,
str_to_time_sql,
@@ -155,7 +154,6 @@ class DuckDB(Dialect):
exp.StrToTime: str_to_time_sql,
exp.StrToUnix: lambda self, e: f"EPOCH(STRPTIME({self.sql(e, 'this')}, {self.format_time(e)}))",
exp.Struct: _struct_sql,
- exp.TableSample: no_tablesample_sql,
exp.TimeStrToDate: lambda self, e: f"CAST({self.sql(e, 'this')} AS DATE)",
exp.TimeStrToTime: timestrtotime_sql,
exp.TimeStrToUnix: lambda self, e: f"EPOCH(CAST({self.sql(e, 'this')} AS TIMESTAMP))",
@@ -179,3 +177,6 @@ class DuckDB(Dialect):
**generator.Generator.STAR_MAPPING,
"except": "EXCLUDE",
}
+
+ def tablesample_sql(self, expression: exp.TableSample, seed_prefix: str = "SEED") -> str:
+ return super().tablesample_sql(expression, seed_prefix="REPEATABLE")