Skip to content

Commit 9408fff

Browse files
committed
Restore YQL-15332 convertations for dq_arrow_helpers (ydb-platform#26633)
1 parent 0e5ab0d commit 9408fff

File tree

4 files changed

+1310
-342
lines changed

4 files changed

+1310
-342
lines changed

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,5 +4767,50 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
47674767
CompareYson(result, R"([[2u]])");
47684768
}
47694769
}
4770+
4771+
Y_UNIT_TEST(PredicateWithTimestampParameter) {
4772+
TKikimrRunner kikimr(TKikimrSettings().SetWithSampleTables(false));
4773+
auto client = kikimr.GetQueryClient();
4774+
4775+
{
4776+
const TString query = R"(
4777+
CREATE TABLE `/Root/tmp_olap` (
4778+
Key Uint32 NOT NULL,
4779+
Value Timestamp NOT NULL,
4780+
PRIMARY KEY (Key)
4781+
) WITH (
4782+
STORE = COLUMN
4783+
);
4784+
)";
4785+
4786+
auto result = client.ExecuteQuery(query, NQuery::TTxControl::NoTx()).GetValueSync();
4787+
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
4788+
}
4789+
{
4790+
const TString query = R"(
4791+
INSERT INTO `/Root/tmp_olap` (Key, Value) VALUES
4792+
(1, Timestamp('2021-01-01T00:00:00Z'))
4793+
)";
4794+
4795+
auto result = client.ExecuteQuery(query, NQuery::TTxControl::NoTx()).GetValueSync();
4796+
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
4797+
}
4798+
{
4799+
const TString query = R"(
4800+
DECLARE $flag1 AS Timestamp;
4801+
SELECT * FROM tmp_olap WHERE Value >= $flag1;
4802+
)";
4803+
4804+
auto params = TParamsBuilder()
4805+
.AddParam("$flag1")
4806+
.Timestamp(TInstant::ParseIso8601("2021-01-01T00:00:00Z"))
4807+
.Build()
4808+
.Build();
4809+
4810+
auto result = client.ExecuteQuery(query, NQuery::TTxControl::BeginTx().CommitTx(), params).GetValueSync();
4811+
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
4812+
UNIT_ASSERT_C(result.GetResultSet(0).RowsCount() == 1, result.GetIssues().ToString());
4813+
}
4814+
}
47704815
}
47714816
}

0 commit comments

Comments
 (0)