From dab6ba29e8eb9a5c2890ac3be8eab6e994aeb10e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 21 Oct 2022 11:29:23 +0200 Subject: Adding upstream version 9.0.1. Signed-off-by: Daniel Baumann --- tests/dialects/test_duckdb.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'tests/dialects/test_duckdb.py') diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py index 298b3e9..625156b 100644 --- a/tests/dialects/test_duckdb.py +++ b/tests/dialects/test_duckdb.py @@ -48,7 +48,7 @@ class TestDuckDB(Validator): self.validate_all( "STRPTIME(x, '%y-%-m')", write={ - "bigquery": "STR_TO_TIME(x, '%y-%-m')", + "bigquery": "PARSE_TIMESTAMP('%y-%m', x)", "duckdb": "STRPTIME(x, '%y-%-m')", "presto": "DATE_PARSE(x, '%y-%c')", "hive": "CAST(FROM_UNIXTIME(UNIX_TIMESTAMP(x, 'yy-M')) AS TIMESTAMP)", @@ -63,6 +63,16 @@ class TestDuckDB(Validator): "hive": "CAST(x AS TIMESTAMP)", }, ) + self.validate_all( + "STRPTIME(x, '%-m/%-d/%y %-I:%M %p')", + write={ + "bigquery": "PARSE_TIMESTAMP('%m/%d/%y %I:%M %p', x)", + "duckdb": "STRPTIME(x, '%-m/%-d/%y %-I:%M %p')", + "presto": "DATE_PARSE(x, '%c/%e/%y %l:%i %p')", + "hive": "CAST(FROM_UNIXTIME(UNIX_TIMESTAMP(x, 'M/d/yy h:mm a')) AS TIMESTAMP)", + "spark": "TO_TIMESTAMP(x, 'M/d/yy h:mm a')", + }, + ) def test_duckdb(self): self.validate_all( @@ -268,6 +278,17 @@ class TestDuckDB(Validator): "spark": "MONTH('2021-03-01')", }, ) + self.validate_all( + "ARRAY_CONCAT(LIST_VALUE(1, 2), LIST_VALUE(3, 4))", + write={ + "duckdb": "ARRAY_CONCAT(LIST_VALUE(1, 2), LIST_VALUE(3, 4))", + "presto": "CONCAT(ARRAY[1, 2], ARRAY[3, 4])", + "hive": "CONCAT(ARRAY(1, 2), ARRAY(3, 4))", + "spark": "CONCAT(ARRAY(1, 2), ARRAY(3, 4))", + "snowflake": "ARRAY_CAT([1, 2], [3, 4])", + "bigquery": "ARRAY_CONCAT([1, 2], [3, 4])", + }, + ) with self.assertRaises(UnsupportedError): transpile( -- cgit v1.2.3