Skip to content

Commit

Permalink
add version conditions to some aggregate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alsugiliazova committed Sep 13, 2024
1 parent 222b7f2 commit d7b201f
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 25 deletions.
14 changes: 10 additions & 4 deletions aggregate_functions/tests/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Specific_Entropy("1.0"))
def scenario(self, func="entropy({params})", table=None, snapshot_id=None):
"""Check entropy aggregate function by using the same tests as for any."""
if check_clickhouse_version(">=24.3")(self) and check_current_cpu("aarch64")(self):
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=24.3")(self) and check_current_cpu("aarch64")(
self
):
clickhouse_version = ">=24.3"
elif check_clickhouse_version("<23.12")(self):
clickhouse_version = ">=23.2"
else:
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
Expand Down
12 changes: 9 additions & 3 deletions aggregate_functions/tests/uniq.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Specific_Uniq("1.0"))
def scenario(self, func="uniq({params})", table=None, snapshot_id=None):
"""Check uniq aggregate function by using the same tests as for any."""
clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down
12 changes: 9 additions & 3 deletions aggregate_functions/tests/uniqCombined.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Specific_UniqCombined("1.0"))
def scenario(self, func="uniqCombined({params})", table=None, snapshot_id=None):
"""Check uniqCombined aggregate function by using the same tests as for uniq."""
clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down
13 changes: 9 additions & 4 deletions aggregate_functions/tests/uniqCombined64.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Specific_UniqCombined64("1.0"))
def scenario(self, func="uniqCombined64({params})", table=None, snapshot_id=None):
"""Check uniqCombined64 aggregate function by using the same tests as for uniq."""

clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down
13 changes: 9 additions & 4 deletions aggregate_functions/tests/uniqExact.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Specific_UniqExact("1.0"))
def scenario(self, func="uniqExact({params})", table=None, snapshot_id=None):
"""Check uniqExact aggregate function by using the same tests as for uniq."""

clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down
12 changes: 9 additions & 3 deletions aggregate_functions/tests/uniqHLL12.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
def scenario(self, func="uniqHLL12({params})", table=None, snapshot_id=None):
"""Check uniqHLL12 aggregate function by using the same tests as for uniq."""

clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down
13 changes: 9 additions & 4 deletions aggregate_functions/tests/uniqTheta.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
@Requirements(RQ_SRS_031_ClickHouse_AggregateFunctions_Miscellaneous_UniqTheta("1.0"))
def scenario(self, func="uniqTheta({params})", table=None, snapshot_id=None):
"""Check uniqTheta aggregate function by using the same tests as for uniq."""

clickhouse_version = (
">=23.2" if check_clickhouse_version("<23.12")(self) else ">=23.12"
)
if check_clickhouse_version(">=24.8")(self):
clickhouse_version = (
">=24.8" # https://github.com/ClickHouse/ClickHouse/issues/69518
)
elif check_clickhouse_version(">=23.12")(self):
clickhouse_version = ">=23.12"
else:
clickhouse_version = ">=23.2"

self.context.snapshot_id = get_snapshot_id(
snapshot_id=snapshot_id,
clickhouse_version=clickhouse_version,
Expand Down

0 comments on commit d7b201f

Please sign in to comment.