summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_clickhouse.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialects/test_clickhouse.py')
-rw-r--r--tests/dialects/test_clickhouse.py20
1 files changed, 19 insertions, 1 deletions
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")
@@ -76,6 +75,9 @@ class TestClickhouse(Validator):
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"
)
self.validate_identity(
@@ -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,
+ )