Skip to content

Commit 7d59a0b

Browse files
Vladilendorooleg
authored andcommitted
Add limit with predicate test (#26118)
1 parent c061c70 commit 7d59a0b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

ydb/core/kqp/ut/olap/kqp_olap_ut.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4703,5 +4703,48 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
47034703
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
47044704
}
47054705
}
4706+
4707+
Y_UNIT_TEST(PredicateWithLimitLostRecords) {
4708+
auto settings = TKikimrSettings().SetWithSampleTables(false);
4709+
settings.AppConfig.MutableTableServiceConfig()->SetEnableOlapSink(true);
4710+
TKikimrRunner kikimr(settings);
4711+
4712+
auto queryClient = kikimr.GetQueryClient();
4713+
{
4714+
auto status = queryClient.ExecuteQuery(R"(
4715+
CREATE TABLE IF NOT EXISTS `olap_table` (
4716+
id Uint64 NOT NULL,
4717+
message Utf8,
4718+
PRIMARY KEY (id)
4719+
)
4720+
WITH (
4721+
STORE = COLUMN,
4722+
PARTITION_COUNT = 1
4723+
);
4724+
)", NYdb::NQuery::TTxControl::NoTx()).GetValueSync();
4725+
UNIT_ASSERT_C(status.IsSuccess(), status.GetIssues().ToString());
4726+
}
4727+
4728+
{
4729+
TString query = "UPSERT INTO `olap_table` (id, message) VALUES (1, '2'), (2, '2');";
4730+
auto status = queryClient.ExecuteQuery(query, NYdb::NQuery::TTxControl::BeginTx().CommitTx()).GetValueSync();
4731+
UNIT_ASSERT_C(status.IsSuccess(), status.GetIssues().ToString());
4732+
}
4733+
4734+
{
4735+
auto status = queryClient.ExecuteQuery(R"(
4736+
SELECT id FROM `olap_table`
4737+
WHERE id = 2 AND message = '2'
4738+
LIMIT 1;
4739+
)", NYdb::NQuery::TTxControl::BeginTx().CommitTx()).GetValueSync();
4740+
4741+
UNIT_ASSERT_C(status.IsSuccess(), status.GetIssues().ToString());
4742+
TString result = FormatResultSetYson(status.GetResultSet(0));
4743+
4744+
CompareYson(result, R"([])");
4745+
// TODO: FIXME
4746+
// CompareYson(result, R"([[2u]])");
4747+
}
4748+
}
47064749
}
47074750
}

0 commit comments

Comments
 (0)