Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions ydb/core/kqp/ut/olap/kqp_olap_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4745,6 +4745,51 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
}
}

Y_UNIT_TEST(PredicateWithTimestampParameter) {
TKikimrRunner kikimr(TKikimrSettings().SetWithSampleTables(false));
auto client = kikimr.GetQueryClient();

{
const TString query = R"(
CREATE TABLE `/Root/tmp_olap` (
Key Uint32 NOT NULL,
Value Timestamp NOT NULL,
PRIMARY KEY (Key)
) WITH (
STORE = COLUMN
);
)";

auto result = client.ExecuteQuery(query, NQuery::TTxControl::NoTx()).GetValueSync();
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
}
{
const TString query = R"(
INSERT INTO `/Root/tmp_olap` (Key, Value) VALUES
(1, Timestamp('2021-01-01T00:00:00Z'))
)";

auto result = client.ExecuteQuery(query, NQuery::TTxControl::NoTx()).GetValueSync();
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
}
{
const TString query = R"(
DECLARE $flag1 AS Timestamp;
SELECT * FROM tmp_olap WHERE Value >= $flag1;
)";

auto params = TParamsBuilder()
.AddParam("$flag1")
.Timestamp(TInstant::ParseIso8601("2021-01-01T00:00:00Z"))
.Build()
.Build();

auto result = client.ExecuteQuery(query, NQuery::TTxControl::BeginTx().CommitTx(), params).GetValueSync();
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
UNIT_ASSERT_C(result.GetResultSet(0).RowsCount() == 1, result.GetIssues().ToString());
}
}

Y_UNIT_TEST(RandomJsonCharacters) {
auto settings = TKikimrSettings();
settings.AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true);
Expand Down
Loading
Loading