Skip to content

Commit 7b1f896

Browse files
committed
test: group by
1 parent 407e0e1 commit 7b1f896

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/operators/operator_class_test.sql

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
\set ON_ERROR_STOP on
22

3-
SELECT create_table_with_encrypted();
4-
SELECT seed_encrypted_json();
3+
--
4+
-- ORE GROUP BY
5+
--
6+
DO $$
7+
BEGIN
58

9+
PERFORM create_table_with_encrypted();
10+
11+
-- Copy ORE data into encrypted
12+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=42;
13+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=42;
14+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=42;
15+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=42;
16+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=99;
17+
INSERT INTO encrypted(e) SELECT e FROM ore WHERE ore.id=99;
18+
19+
-- Should be the rows with value of 42
20+
PERFORM assert_id(
21+
'GROUP BY eql_v2_encrypted',
22+
'SELECT count(id) FROM encrypted GROUP BY e ORDER BY count(id) DESC',
23+
4);
24+
END;
25+
$$ LANGUAGE plpgsql;
626

727
--
828
-- Confirm index used correctly
@@ -157,8 +177,6 @@ DO $$
157177

158178
EXECUTE 'EXPLAIN ANALYZE SELECT e::jsonb FROM encrypted WHERE e = ''("{\"blah\": \"vtha\"}")'';' into result;
159179

160-
PERFORM eql_v2.log(result);
161-
162180
IF position('Index Only Scan using encrypted' in result) > 0 THEN
163181
ASSERT true;
164182
ELSE

0 commit comments

Comments
 (0)