From 5f8be2e0852f3c925fb873a48946caee3050899f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 31 Jan 2024 06:44:37 +0100 Subject: Adding upstream version 20.11.0. Signed-off-by: Daniel Baumann --- tests/dialects/test_clickhouse.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests/dialects/test_clickhouse.py') diff --git a/tests/dialects/test_clickhouse.py b/tests/dialects/test_clickhouse.py index 84903aa..f36af41 100644 --- a/tests/dialects/test_clickhouse.py +++ b/tests/dialects/test_clickhouse.py @@ -42,7 +42,6 @@ class TestClickhouse(Validator): self.validate_identity("SELECT isNaN(1.0)") self.validate_identity("SELECT startsWith('Spider-Man', 'Spi')") self.validate_identity("SELECT xor(TRUE, FALSE)") - self.validate_identity("ATTACH DATABASE DEFAULT ENGINE = ORDINARY") self.validate_identity("CAST(['hello'], 'Array(Enum8(''hello'' = 1))')") self.validate_identity("SELECT x, COUNT() FROM y GROUP BY x WITH TOTALS") self.validate_identity("SELECT INTERVAL t.days DAY") @@ -75,6 +74,9 @@ class TestClickhouse(Validator): self.validate_identity("CAST(x AS DATETIME)") self.validate_identity("CAST(x as MEDIUMINT)", "CAST(x AS Int32)") self.validate_identity("SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src") + self.validate_identity( + "ATTACH DATABASE DEFAULT ENGINE = ORDINARY", check_command_warning=True + ) self.validate_identity( "SELECT n, source FROM (SELECT toFloat32(number % 10) AS n, 'original' AS source FROM numbers(10) WHERE number % 3 = 1) ORDER BY n WITH FILL" ) @@ -728,3 +730,19 @@ LIFETIME(MIN 0 MAX 0)""", ) self.validate_identity("""CREATE TABLE ip_data (ip4 IPv4, ip6 IPv6) ENGINE=TinyLog()""") self.validate_identity("""CREATE TABLE dates (dt1 Date32) ENGINE=TinyLog()""") + self.validate_all( + """ + CREATE TABLE t ( + a AggregateFunction(quantiles(0.5, 0.9), UInt64), + b AggregateFunction(quantiles, UInt64), + c SimpleAggregateFunction(sum, Float64) + )""", + write={ + "clickhouse": """CREATE TABLE t ( + a AggregateFunction(quantiles(0.5, 0.9), UInt64), + b AggregateFunction(quantiles, UInt64), + c SimpleAggregateFunction(sum, Float64) +)""" + }, + pretty=True, + ) -- cgit v1.2.3