diff options
Diffstat (limited to 'tests/dialects/test_duckdb.py')
-rw-r--r-- | tests/dialects/test_duckdb.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py index 5c35d8f..c33c899 100644 --- a/tests/dialects/test_duckdb.py +++ b/tests/dialects/test_duckdb.py @@ -337,6 +337,8 @@ class TestDuckDB(Validator): unsupported_level=ErrorLevel.IMMEDIATE, ) + self.validate_identity("SELECT ISNAN(x)") + def test_time(self): self.validate_identity("SELECT CURRENT_DATE") self.validate_identity("SELECT CURRENT_TIMESTAMP") @@ -399,7 +401,7 @@ class TestDuckDB(Validator): "bigquery": "TIME_TO_STR(x, '%y-%-m-%S')", "duckdb": "STRFTIME(x, '%y-%-m-%S')", "postgres": "TO_CHAR(x, 'YY-FMMM-SS')", - "presto": "DATE_FORMAT(x, '%y-%c-%S')", + "presto": "DATE_FORMAT(x, '%y-%c-%s')", "spark": "DATE_FORMAT(x, 'yy-M-ss')", }, ) @@ -497,8 +499,12 @@ class TestDuckDB(Validator): self.validate_identity("CAST(x AS USMALLINT)") self.validate_identity("CAST(x AS UTINYINT)") self.validate_identity("CAST(x AS TEXT)") + self.validate_identity("CAST(x AS INT128)") + self.validate_identity("CAST(x AS DOUBLE)") + self.validate_identity("CAST(x AS DECIMAL(15, 4))") - self.validate_all("CAST(x AS NUMERIC)", write={"duckdb": "CAST(x AS DOUBLE)"}) + self.validate_all("CAST(x AS NUMERIC(1, 2))", write={"duckdb": "CAST(x AS DECIMAL(1, 2))"}) + self.validate_all("CAST(x AS HUGEINT)", write={"duckdb": "CAST(x AS INT128)"}) self.validate_all("CAST(x AS CHAR)", write={"duckdb": "CAST(x AS TEXT)"}) self.validate_all("CAST(x AS BPCHAR)", write={"duckdb": "CAST(x AS TEXT)"}) self.validate_all("CAST(x AS STRING)", write={"duckdb": "CAST(x AS TEXT)"}) @@ -514,6 +520,20 @@ class TestDuckDB(Validator): self.validate_all("CAST(x AS VARBINARY)", write={"duckdb": "CAST(x AS BLOB)"}) self.validate_all("CAST(x AS LOGICAL)", write={"duckdb": "CAST(x AS BOOLEAN)"}) self.validate_all( + "CAST(x AS NUMERIC)", + write={ + "duckdb": "CAST(x AS DECIMAL(18, 3))", + "postgres": "CAST(x AS DECIMAL(18, 3))", + }, + ) + self.validate_all( + "CAST(x AS DECIMAL)", + write={ + "duckdb": "CAST(x AS DECIMAL(18, 3))", + "postgres": "CAST(x AS DECIMAL(18, 3))", + }, + ) + self.validate_all( "CAST(x AS BIT)", read={ "duckdb": "CAST(x AS BITSTRING)", |