Skip to content

Commit a642f40

Browse files
authored
CTAS: fix make (#22563)
1 parent 10f796c commit a642f40

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ydb/tests/stress/ctas/workload/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import ydb
33
import time
4-
import random
54
import threading
6-
from enum import Enum
75

86
from ydb.tests.stress.common.common import WorkloadBase
97

@@ -23,7 +21,7 @@ def __init__(self, client, prefix, stop, is_olap):
2321
def get_stat(self):
2422
with self.lock:
2523
return f"Tables: {self.tables_count}, TotalRows: {self.total_rows}, LastTableRows: {self.prev_rows[0]}"
26-
24+
2725
def get_create_query(self):
2826
table_path = self.get_table_path(self.table_name + str(self.tables_count))
2927

@@ -32,7 +30,7 @@ def get_create_query(self):
3230
params = "STORE = COLUMN"
3331
else:
3432
params = "STORE = ROW"
35-
33+
3634
if self.tables_count == 0:
3735
return f"""
3836
CREATE TABLE `{table_path}` (
@@ -51,9 +49,9 @@ def get_create_query(self):
5149
WITH (
5250
{params}
5351
) AS SELECT
54-
Unwrap(CAST(1 AS Uint64)) AS Key, "{ ('0' * self.value_bytes) }" AS Value;
52+
Unwrap(CAST(1 AS Uint64)) AS Key, "{('0' * self.value_bytes)}" AS Value;
5553
"""
56-
54+
5755
def get_ctas_query(self):
5856
table_path = self.get_table_path(self.table_name + str(self.tables_count))
5957
prev_table_path1 = self.get_table_path(self.table_name + str(self.tables_count - 1))
@@ -66,10 +64,10 @@ def get_ctas_query(self):
6664
FROM `{prev_table_path1}`
6765
UNION ALL
6866
SELECT
69-
Key + Unwrap(CAST({self.prev_rows[0]} AS Uint64)) AS Key, Value
67+
Key + Unwrap(CAST({self.prev_rows[0]} AS Uint64)) AS Key, Value
7068
FROM `{prev_table_path2}`
7169
"""
72-
70+
7371
def prepare(self):
7472
create_query = self.get_create_query()
7573
self.client.query(
@@ -84,7 +82,6 @@ def prepare(self):
8482
)
8583
self.tables_count += 1
8684

87-
8885
def _loop(self):
8986
self.prepare()
9087

@@ -105,7 +102,7 @@ def _loop(self):
105102
expected = self.prev_rows[0] + self.prev_rows[1]
106103
if actual != expected:
107104
raise Exception(f"Incorrect result: expected:{expected}, actual:{actual}")
108-
105+
109106
self.prev_rows = (actual, self.prev_rows[0])
110107
self.total_rows += actual
111108
self.tables_count += 1

ydb/tests/stress/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
RECURSE(
22
cdc
33
common
4+
ctas
45
kv
56
log
67
mixedpy

0 commit comments

Comments
 (0)