-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
227 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from conftest import BaseTestSet | ||
from ydb.tests.olap.scenario.helpers import ( | ||
ScenarioTestHelper, | ||
TestContext, | ||
CreateTable, | ||
CreateTableStore, | ||
AlterObject, | ||
AlterSharding | ||
) | ||
from ydb import PrimitiveType, StatusCode | ||
import ydb.tests.olap.scenario.helpers.data_generators as dg | ||
import time | ||
|
||
|
||
class TestPartitioning(BaseTestSet): | ||
schema1 = ( | ||
ScenarioTestHelper.Schema() | ||
.with_column(name='id', type=PrimitiveType.Int32, not_null=True) | ||
.with_column(name='level', type=PrimitiveType.Uint32) | ||
.with_key_columns('id') | ||
) | ||
|
||
def _test_table(self, ctx: TestContext, table_name: str): | ||
sth = ScenarioTestHelper(ctx) | ||
sth.execute_scheme_query(CreateTable(table_name).with_schema(self.schema1).with_partitions_count(2)) | ||
|
||
sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
sth.execute_scheme_query(AlterObject(table_name).action(AlterSharding("SPLIT"))) | ||
|
||
# sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
time.sleep(240) | ||
|
||
sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
sth.execute_scheme_query(AlterObject(table_name).action(AlterSharding("SPLIT"))) | ||
|
||
# sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
time.sleep(240) | ||
|
||
sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
sth.execute_scheme_query(AlterObject(table_name).action(AlterSharding("MERGE"))) | ||
|
||
# sth.bulk_upsert(table_name, dg.DataGeneratorPerColumn(self.schema1, 100), comment="100 sequetial ids") | ||
|
||
# gen = dg.DataGeneratorPerColumn(self.schema1, 100, dg.ColumnValueGeneratorDefault(init_value=200)) | ||
# sth.bulk_upsert(table_name, gen, comment="100 sequetial ids") | ||
|
||
|
||
def scenario_table(self, ctx: TestContext): | ||
tablestore_name = "testStore5" | ||
sth = ScenarioTestHelper(ctx) | ||
sth.execute_scheme_query(CreateTableStore(tablestore_name).with_schema(self.schema1)) | ||
self._test_table(ctx, tablestore_name + '/testTable') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ PY3TEST() | |
test_simple.py | ||
test_scheme_load.py | ||
test_alter_tiering.py | ||
test_partitioning.py | ||
) | ||
|
||
PEERDIR( | ||
|