Skip to content

Commit 24df9b9

Browse files
committed
py: add illarg tests for window aggregates
Signed-off-by: rivudhk <rivudhkr@gmail.com>
1 parent 36d634f commit 24df9b9

File tree

5 files changed

+378
-33
lines changed

5 files changed

+378
-33
lines changed

python/tests/runtime_aggtest/illarg_tests/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from test_str_unicode_fn import * # noqa: F403
1212
from test_check_negative_tests import * # noqa: F403
1313
from test_cmp_operators import * # noqa: F403
14+
from test_window_agg import * # noqa: F403
1415
from test_illegal_tbl import * # noqa: F403
1516

1617

python/tests/runtime_aggtest/illarg_tests/test_arr_map_type_fn.py

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ def __init__(self):
7575
None,
7676
"14",
7777
"hello ",
78+
"TRUE",
7879
"bye",
7980
"14",
8081
"See you!",
8182
"-0.52",
8283
None,
8384
"14",
8485
"hello ",
86+
"TRUE",
8587
]
8688
}
8789
]
@@ -115,6 +117,7 @@ def __init__(self):
115117
None,
116118
"14",
117119
"hello ",
120+
"TRUE",
118121
"hello ",
119122
],
120123
"udt": [{"i1": 4, "v1": "cat"}, {"i1": 4, "v1": "cat"}],
@@ -141,7 +144,9 @@ def __init__(self):
141144
class illarg_arr_compact_legal(TstView):
142145
def __init__(self):
143146
# checked manually
144-
self.data = [{"arr": ["bye", "14", "See you!", "-0.52", "14", "hello "]}]
147+
self.data = [
148+
{"arr": ["bye", "14", "See you!", "-0.52", "14", "hello ", "TRUE"]}
149+
]
145150
self.sql = """CREATE MATERIALIZED VIEW arr_compact_legal AS SELECT
146151
ARRAY_COMPACT(arr) AS arr
147152
FROM illegal_tbl
@@ -184,7 +189,9 @@ def __init__(self):
184189
class illarg_arr_distinct_legal(TstView):
185190
def __init__(self):
186191
# checked manually
187-
self.data = [{"arr": ["bye", "14", "See you!", "-0.52", None, "hello "]}]
192+
self.data = [
193+
{"arr": ["bye", "14", "See you!", "-0.52", None, "hello ", "TRUE"]}
194+
]
188195
self.sql = """CREATE MATERIALIZED VIEW arr_distinct_legal AS SELECT
189196
ARRAY_DISTINCT(arr) AS arr
190197
FROM illegal_tbl
@@ -207,8 +214,8 @@ def __init__(self):
207214
# checked manually
208215
self.data = [
209216
{
210-
"arr": [None, "-0.52", "14", "See you!", "bye"],
211-
"arr1": [None, "-0.52", "14", "See you!", "bye"],
217+
"arr": [None, "-0.52", "14", "See you!", "TRUE", "bye"],
218+
"arr1": [None, "-0.52", "14", "See you!", "TRUE", "bye"],
212219
"arr_udt": [{"i1": 4, "v1": "cat"}],
213220
}
214221
]
@@ -258,7 +265,17 @@ def __init__(self):
258265
# checked manually
259266
self.data = [
260267
{
261-
"arr": ["bye", "14", "See you!", "-0.52", None, "14", "hello ", "fred"],
268+
"arr": [
269+
"bye",
270+
"14",
271+
"See you!",
272+
"-0.52",
273+
None,
274+
"14",
275+
"hello ",
276+
"fred",
277+
"TRUE",
278+
],
262279
"udt": [{"i1": 4, "v1": "cat"}, None, None, {"i1": 4, "v1": "cat"}],
263280
}
264281
]
@@ -304,7 +321,7 @@ def __init__(self):
304321
class illarg_arr_join_legal(TstView):
305322
def __init__(self):
306323
# checked manually
307-
self.data = [{"arr": "bye,14,See you!,-0.52,*,14,hello "}]
324+
self.data = [{"arr": "bye,14,See you!,-0.52,*,14,hello ,TRUE"}]
308325
self.sql = """CREATE MATERIALIZED VIEW arr_join_legal AS SELECT
309326
ARRAY_JOIN(arr,',', '*') AS arr
310327
FROM illegal_tbl
@@ -334,7 +351,7 @@ def __init__(self):
334351
class illarg_arr_to_string_legal(TstView):
335352
def __init__(self):
336353
# checked manually
337-
self.data = [{"arr": "bye,14,See you!,-0.52,*,14,hello "}]
354+
self.data = [{"arr": "bye,14,See you!,-0.52,*,14,hello ,TRUE"}]
338355
self.sql = """CREATE MATERIALIZED VIEW arr_to_string_legal AS SELECT
339356
ARRAY_JOIN(arr,',', '*') AS arr
340357
FROM illegal_tbl
@@ -355,7 +372,7 @@ def __init__(self):
355372
class illarg_arr_length_legal(TstView):
356373
def __init__(self):
357374
# checked manually
358-
self.data = [{"arr": 7}]
375+
self.data = [{"arr": 8}]
359376
self.sql = """CREATE MATERIALIZED VIEW arr_length_legal AS SELECT
360377
ARRAY_LENGTH(arr) AS arr
361378
FROM illegal_tbl
@@ -376,7 +393,7 @@ def __init__(self):
376393
class illarg_arr_cardinality_legal(TstView):
377394
def __init__(self):
378395
# checked manually
379-
self.data = [{"arr": 7}]
396+
self.data = [{"arr": 8}]
380397
self.sql = """CREATE MATERIALIZED VIEW arr_cardinality_legal AS SELECT
381398
CARDINALITY(arr) AS arr
382399
FROM illegal_tbl
@@ -482,7 +499,19 @@ class illarg_arr_prepend_legal(TstView):
482499
def __init__(self):
483500
# checked manually
484501
self.data = [
485-
{"arr": ["friend", "bye", "14", "See you!", "-0.52", None, "14", "hello "]}
502+
{
503+
"arr": [
504+
"friend",
505+
"bye",
506+
"14",
507+
"See you!",
508+
"-0.52",
509+
None,
510+
"14",
511+
"hello ",
512+
"TRUE",
513+
]
514+
}
486515
]
487516
self.sql = """CREATE MATERIALIZED VIEW arr_prepend_legal AS SELECT
488517
ARRAY_PREPEND(arr, 'friend') AS arr
@@ -504,7 +533,9 @@ def __init__(self):
504533
class illarg_arr_remove_legal(TstView):
505534
def __init__(self):
506535
# checked manually
507-
self.data = [{"arr": ["bye", "14", "-0.52", None, "14", "hello "], "udt": []}]
536+
self.data = [
537+
{"arr": ["bye", "14", "-0.52", None, "14", "hello ", "TRUE"], "udt": []}
538+
]
508539
self.sql = """CREATE MATERIALIZED VIEW arr_remove_legal AS SELECT
509540
ARRAY_REMOVE(arr, 'See you!') AS arr,
510541
ARRAY_REMOVE(ARRAY[udt], (4, 'cat')) AS udt
@@ -526,7 +557,9 @@ def __init__(self):
526557
class illarg_arr_reverse_legal(TstView):
527558
def __init__(self):
528559
# checked manually
529-
self.data = [{"arr": ["hello ", "14", None, "-0.52", "See you!", "14", "bye"]}]
560+
self.data = [
561+
{"arr": ["TRUE", "hello ", "14", None, "-0.52", "See you!", "14", "bye"]}
562+
]
530563
self.sql = """CREATE MATERIALIZED VIEW arr_reverse_legal AS SELECT
531564
ARRAY_REVERSE(arr) AS arr
532565
FROM illegal_tbl
@@ -550,8 +583,8 @@ def __init__(self):
550583
self.data = [
551584
{
552585
"arr": [
553-
["bye", "14", "See you!", "-0.52", None, "14", "hello "],
554-
["bye", "14", "See you!", "-0.52", None, "14", "hello "],
586+
["bye", "14", "See you!", "-0.52", None, "14", "hello ", "TRUE"],
587+
["bye", "14", "See you!", "-0.52", None, "14", "hello ", "TRUE"],
555588
]
556589
}
557590
]
@@ -604,7 +637,18 @@ class illarg_arr_union_legal(TstView):
604637
def __init__(self):
605638
# checked manually
606639
self.data = [
607-
{"arr": [None, "-0.52", "14", "See you!", "bye", "friend", "hello "]}
640+
{
641+
"arr": [
642+
None,
643+
"-0.52",
644+
"14",
645+
"See you!",
646+
"TRUE",
647+
"bye",
648+
"friend",
649+
"hello ",
650+
]
651+
}
608652
]
609653
self.sql = """CREATE MATERIALIZED VIEW arr_union_legal AS SELECT
610654
ARRAY_UNION(arr, ARRAY['friend']) AS arr
@@ -647,7 +691,9 @@ def __init__(self):
647691
class illarg_sort_arr_legal(TstView):
648692
def __init__(self):
649693
# checked manually
650-
self.data = [{"arr": ["hello ", "bye", "See you!", "14", "14", "-0.52", None]}]
694+
self.data = [
695+
{"arr": ["hello ", "bye", "TRUE", "See you!", "14", "14", "-0.52", None]}
696+
]
651697
self.sql = """CREATE MATERIALIZED VIEW sort_arr_legal AS SELECT
652698
SORT_ARRAY(arr, False) AS arr
653699
FROM illegal_tbl
@@ -668,7 +714,9 @@ def __init__(self):
668714
class illarg_transform_arr_legal(TstView):
669715
def __init__(self):
670716
# checked manually
671-
self.data = [{"arr": ["BYE", "14", "SEE YOU!", "-0.52", None, "14", "HELLO "]}]
717+
self.data = [
718+
{"arr": ["BYE", "14", "SEE YOU!", "-0.52", None, "14", "HELLO ", "TRUE"]}
719+
]
672720
self.sql = """CREATE MATERIALIZED VIEW transform_arr_legal AS SELECT
673721
TRANSFORM(arr, x -> UPPER(X)) AS arr
674722
FROM illegal_tbl

0 commit comments

Comments
 (0)