-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathtest_varbinary_count.py
More file actions
39 lines (31 loc) · 1.39 KB
/
Copy pathtest_varbinary_count.py
File metadata and controls
39 lines (31 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from .aggtst_base import TstView
class aggtst_varbinary_count(TstView):
def __init__(self):
# Validated on Postgres
self.data = [{"count": 4}]
self.sql = """CREATE MATERIALIZED VIEW varbinary_count AS SELECT
COUNT(*) AS count
FROM varbinary_tbl"""
class aggtst_varbinary_count_groupby(TstView):
def __init__(self):
# Validated on Postgres
self.data = [{"id": 0, "count": 2}, {"id": 1, "count": 2}]
self.sql = """CREATE MATERIALIZED VIEW varbinary_count_gby AS SELECT
id, COUNT(*) AS count
FROM varbinary_tbl
GROUP BY id"""
class aggtst_varbinary_count_where(TstView):
def __init__(self):
# Validated on Postgres
self.data = [{"count": 2}]
self.sql = """CREATE MATERIALIZED VIEW varbinary_count_where AS SELECT
COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM varbinary_tbl"""
class aggtst_varbinary_count_where_groupby(TstView):
def __init__(self):
# Validated on Postgres
self.data = [{"id": 0, "count": 1}, {"id": 1, "count": 1}]
self.sql = """CREATE MATERIALIZED VIEW varbinary_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM varbinary_tbl
GROUP BY id"""