Skip to content

Commit d39b14f

Browse files
authored
YDB FQ: enable pushdown of string types in Generic provider (#16834)
1 parent fca7a28 commit d39b14f

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

ydb/library/yql/providers/generic/provider/ut/pushdown/pushdown_ut.cpp

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ struct TPushdownFixture: public NUnitTest::TBaseFixture {
352352
void AssertFilter(const TString& lambdaText, const TString& filterText) {
353353
const auto& filter = BuildProtoFilterFromLambda(lambdaText);
354354
NConnector::NApi::TPredicate expectedFilter;
355-
UNIT_ASSERT(google::protobuf::TextFormat::ParseFromString(filterText, &expectedFilter));
355+
UNIT_ASSERT_C(google::protobuf::TextFormat::ParseFromString(filterText, &expectedFilter), expectedFilter.InitializationErrorString());
356356
UNIT_ASSERT_STRINGS_EQUAL(filter.Utf8DebugString(), expectedFilter.Utf8DebugString());
357357
}
358358

@@ -657,7 +657,7 @@ Y_UNIT_TEST_SUITE_F(PushdownTest, TPushdownFixture) {
657657
}
658658

659659
Y_UNIT_TEST(StringFieldsNotSupported) {
660-
AssertNoPush(
660+
AssertFilter(
661661
// Note that R"ast()ast" is empty string!
662662
R"ast(
663663
(Coalesce
@@ -667,17 +667,48 @@ Y_UNIT_TEST_SUITE_F(PushdownTest, TPushdownFixture) {
667667
)
668668
(Bool '"false")
669669
)
670-
)ast");
670+
)ast",
671+
R"proto(
672+
comparison {
673+
operation: EQ
674+
left_value {
675+
column: "col_utf8"
676+
}
677+
right_value {
678+
column: "col_optional_utf8"
679+
}
680+
}
681+
)proto"
682+
);
671683
}
672684

673685
Y_UNIT_TEST(StringFieldsNotSupported2) {
674-
AssertNoPush(
686+
AssertFilter(
675687
// Note that R"ast()ast" is empty string!
676688
R"ast(
677689
(!=
678690
(Member $row '"col_string")
679691
(String '"value")
680692
)
681-
)ast");
693+
)ast",
694+
R"proto(
695+
comparison {
696+
operation: NE
697+
left_value {
698+
column: "col_string"
699+
}
700+
right_value {
701+
typed_value {
702+
type {
703+
type_id: STRING
704+
}
705+
value {
706+
bytes_value: "value"
707+
}
708+
}
709+
}
710+
}
711+
)proto"
712+
);
682713
}
683714
}

ydb/library/yql/providers/generic/provider/yql_generic_physical_opt.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ namespace NYql {
2727
: NPushdown::TSettings(NLog::EComponent::ProviderGeneric)
2828
{
2929
using EFlag = NPushdown::TSettings::EFeatureFlag;
30-
Enable(EFlag::ExpressionAsPredicate | EFlag::ArithmeticalExpressions | EFlag::ImplicitConversionToInt64 | EFlag::DateTimeTypes | EFlag::TimestampCtor);
30+
Enable(
31+
EFlag::ExpressionAsPredicate |
32+
EFlag::ArithmeticalExpressions |
33+
EFlag::ImplicitConversionToInt64 |
34+
EFlag::DateTimeTypes |
35+
EFlag::TimestampCtor |
36+
EFlag::StringTypes);
3137
}
3238
};
3339

0 commit comments

Comments
 (0)