summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ydb/tests/stress/oltp_workload/__main__.py40
1 files changed, 30 insertions, 10 deletions
diff --git a/ydb/tests/stress/oltp_workload/__main__.py b/ydb/tests/stress/oltp_workload/__main__.py
index f3f937fa2d3..172b369db5d 100644
--- a/ydb/tests/stress/oltp_workload/__main__.py
+++ b/ydb/tests/stress/oltp_workload/__main__.py
@@ -11,9 +11,13 @@ ydb.interceptor.monkey_patch_event_handler()
supported_pk_types = [
"Int64",
"Uint64",
- "Bool",
+ "Int32",
+ "Uint32",
+ "Int16",
+ "Uint16",
"Int8",
"Uint8",
+ "Bool",
"Decimal(1,0)",
"Decimal(22,9)",
"Decimal(35,10)",
@@ -41,6 +45,13 @@ supported_types = supported_pk_types + [
"Yson"
]
+null_types = [
+ "Int64",
+ "Decimal(22,9)",
+ "Decimal(35,10)",
+ "String",
+]
+
class WorkloadInsertDeleteAllTypes(WorkloadBase):
def __init__(self, client, prefix, stop):
@@ -59,9 +70,12 @@ class WorkloadInsertDeleteAllTypes(WorkloadBase):
create_sql = f"""
CREATE TABLE `{table_path}` (
{", ".join(["pk" + str(i) + " " + supported_pk_types[i] for i in range(len(supported_pk_types))])},
+ {", ".join(["null_pk" + str(i) + " " + null_types[i] for i in range(len(null_types))])},
{", ".join(["col" + str(i) + " " + supported_types[i] for i in range(len(supported_types))])},
+ {", ".join(["null_col" + str(i) + " " + null_types[i] for i in range(len(null_types))])},
PRIMARY KEY(
- {", ".join(["pk" + str(i) for i in range(len(supported_pk_types))])}
+ {", ".join(["pk" + str(i) for i in range(len(supported_pk_types))])},
+ {", ".join(["null_pk" + str(i) for i in range(len(null_types))])}
)
)
"""
@@ -73,33 +87,39 @@ class WorkloadInsertDeleteAllTypes(WorkloadBase):
insert_sql = f"""
INSERT INTO `{table_path}` (
{", ".join(["pk" + str(i) for i in range(len(supported_pk_types))])},
- {", ".join(["col" + str(i) for i in range(len(supported_types))])}
+ {", ".join(["null_pk" + str(i) for i in range(len(null_types))])},
+ {", ".join(["col" + str(i) for i in range(len(supported_types))])},
+ {", ".join(["null_col" + str(i) for i in range(len(null_types))])}
)
VALUES
({i * 2}, {i * 10},
- false, -1, 1,
+ -2147483648, 0, -32768, 0, -128, 0, false,
CAST('1' AS Decimal(1,0)), CAST('1234567890123456789.000000001' AS Decimal(22,9)), CAST('1234567890123456789123456789.000000001' AS Decimal(35,10)),
CAST('-1.234' AS DyNumber), 'AnotherString', 'AnotherUtf8', CAST('123e4567-e89b-12d3-a456-556642440000' AS Uuid),
CAST('2023-10-02' AS Date), CAST('2023-10-02T11:00:00' AS Datetime), CAST(1696243200000000 AS Timestamp), CAST(-86400 AS Interval),
Date32('998-06-02'), CAST('2023-10-02T11:00:00.654321' AS Datetime64), Timestamp64('0998-06-02T12:30:00.123456Z'),Interval64('PT2S'),
- -2000000, {i * 10}, true, -2, 2,
+ NULL, NULL, NULL, NULL,
+ -2000000, {i * 10}, -222, 222, -22, 22, -2, 2, true,
CAST('2' AS Decimal(1,0)), CAST('2234567890123456789.000000001' AS Decimal(22,9)), CAST('2234567890123456789123456789.000000001' AS Decimal(35,10)),
CAST('123E4' AS DyNumber), 'SampleString', 'SampleUtf8', CAST('550e8400-e29b-41d4-a716-446655440000' AS Uuid),
CAST('2023-10-01' AS Date), CAST('2023-10-01T10:00:00' AS Datetime), CAST(1696156800000000 AS Timestamp), CAST(3600 AS Interval),
Date32('998-06-01'), CAST('2023-10-01T10:00:00.123456' AS Datetime64), Timestamp64('0998-06-02T12:30:00.678901Z'),Interval64('-PT2S'), 3.14f, 2.71828,
- CAST('{{"json_key":"json_value"}}' AS Json), CAST('{{"doc_key":"doc_value"}}' AS JsonDocument), CAST('<yson><key1>value1</key1></yson>' AS Yson)),
+ CAST('{{"json_key":"json_value"}}' AS Json), CAST('{{"doc_key":"doc_value"}}' AS JsonDocument), CAST('<yson><key1>value1</key1></yson>' AS Yson),
+ NULL, NULL, NULL, NULL),
({i * 2 + 1}, {i * 10 + 1},
- true, -3, 3,
+ 2147483647, 4294967295, 32767, 65535, 127, 255, true,
CAST('3' AS Decimal(1,0)), CAST('3234567890123456789.000000001' AS Decimal(22,9)), CAST('3234567890123456789123456789.000000001' AS Decimal(35,10)),
CAST('4.567E-3' AS DyNumber), 'ExampleString', 'ExampleUtf8', CAST('00112233-4455-6677-8899-aabbccddeeff' AS Uuid),
CAST('2022-12-31' AS Date), CAST('2022-12-31T23:59:59' AS Datetime), CAST(1672444799000000 AS Timestamp), CAST(172800 AS Interval),
Date32('1000-01-01'), CAST('2022-12-31T23:59:59.999999' AS Datetime64), Timestamp64('1000-01-01T00:00:00.000000Z'), Interval64('PT1440M'),
- -4000000, {i * 10 + 1}, false, -4, 4,
+ NULL, NULL, NULL, NULL,
+ -4000000, {i * 10 + 1}, -444, 444, -44, 44, -4, 4, false,
CAST('4' AS Decimal(1,0)), CAST('4234567890123456789.000000001' AS Decimal(22,9)), CAST('4234567890123456789123456789.000000001' AS Decimal(35,10)),
CAST('-987E-4' AS DyNumber), 'NewString', 'NewUtf8', CAST('01234567-89ab-cdef-0123-456789abcdef' AS Uuid),
CAST('1980-03-15' AS Date), CAST('1980-03-15T08:00:00' AS Datetime), CAST(315532800000000 AS Timestamp), CAST(-31536000 AS Interval),
Date32('2000-02-29'), CAST('1980-03-15T08:00:00.123456' AS Datetime64), Timestamp64('2000-02-29T12:30:00.999999Z'), Interval64('-PT600S'), -0.123f, 2.71828,
- CAST('{{"another_key":"another_value"}}' AS Json), CAST('{{"another_doc_key":"another_doc_value"}}' AS JsonDocument), CAST('<yson><key2>value2</key2></yson>' AS Yson));
+ CAST('{{"another_key":"another_value"}}' AS Json), CAST('{{"another_doc_key":"another_doc_value"}}' AS JsonDocument), CAST('<yson><key2>value2</key2></yson>' AS Yson),
+ NULL, NULL, NULL, NULL);
"""
# print(insert_sql)
self.client.query(insert_sql, False,)
@@ -107,7 +127,7 @@ class WorkloadInsertDeleteAllTypes(WorkloadBase):
self.client.query(
f"""
DELETE FROM `{table_path}`
- WHERE col1 % 2 == 1
+ WHERE col1 % 2 == 1 AND null_pk0 IS NULL
""",
False,
)