mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Adding test to check default window function frame.
This commit is contained in:
parent
bc4b696bf9
commit
a5d5f13497
@ -3,6 +3,45 @@ from testflows.core import *
|
|||||||
from window_functions.requirements import *
|
from window_functions.requirements import *
|
||||||
from window_functions.tests.common import *
|
from window_functions.tests.common import *
|
||||||
|
|
||||||
|
@TestFeature
|
||||||
|
@Requirements(
|
||||||
|
RQ_SRS_019_ClickHouse_WindowFunctions_FrameClause_DefaultFrame("1.0")
|
||||||
|
)
|
||||||
|
def default_frame(self):
|
||||||
|
"""Check default frame.
|
||||||
|
"""
|
||||||
|
with Scenario("with order by"):
|
||||||
|
expected = convert_output("""
|
||||||
|
number | sum
|
||||||
|
---------+------
|
||||||
|
1 | 2
|
||||||
|
1 | 2
|
||||||
|
2 | 4
|
||||||
|
3 | 10
|
||||||
|
3 | 10
|
||||||
|
""")
|
||||||
|
|
||||||
|
execute_query(
|
||||||
|
"select number, sum(number) OVER (ORDER BY number) AS sum FROM values('number Int8', (1),(1),(2),(3),(3))",
|
||||||
|
expected=expected
|
||||||
|
)
|
||||||
|
|
||||||
|
with Scenario("without order by"):
|
||||||
|
expected = convert_output("""
|
||||||
|
number | sum
|
||||||
|
---------+------
|
||||||
|
1 | 10
|
||||||
|
1 | 10
|
||||||
|
2 | 10
|
||||||
|
3 | 10
|
||||||
|
3 | 10
|
||||||
|
""")
|
||||||
|
|
||||||
|
execute_query(
|
||||||
|
"select number, sum(number) OVER () AS sum FROM values('number Int8', (1),(1),(2),(3),(3))",
|
||||||
|
expected=expected
|
||||||
|
)
|
||||||
|
|
||||||
@TestFeature
|
@TestFeature
|
||||||
@Name("frame clause")
|
@Name("frame clause")
|
||||||
@Requirements(
|
@Requirements(
|
||||||
@ -22,8 +61,9 @@ from window_functions.tests.common import *
|
|||||||
def feature(self):
|
def feature(self):
|
||||||
"""Check defining frame clause.
|
"""Check defining frame clause.
|
||||||
"""
|
"""
|
||||||
|
Feature(run=default_frame, flags=TE)
|
||||||
Feature(run=load("window_functions.tests.rows_frame", "feature"), flags=TE)
|
Feature(run=load("window_functions.tests.rows_frame", "feature"), flags=TE)
|
||||||
Feature(run=load("window_functions.tests.range_frame", "feature"), flags=TE)
|
Feature(run=load("window_functions.tests.range_frame", "feature"), flags=TE)
|
||||||
Feature(run=load("window_functions.tests.range_overflow", "feature"), flags=TE)
|
Feature(run=load("window_functions.tests.range_overflow", "feature"), flags=TE)
|
||||||
Feature(run=load("window_functions.tests.range_datetime", "feature"), flags=TE)
|
Feature(run=load("window_functions.tests.range_datetime", "feature"), flags=TE)
|
||||||
Feature(run=load("window_functions.tests.range_errors", "feature"), flags=TE)
|
Feature(run=load("window_functions.tests.range_errors", "feature"), flags=TE)
|
||||||
|
Loading…
Reference in New Issue
Block a user