Skip to content

Commit e4ebce3

Browse files
authored
row dispatcher/format_handler: restore compatibility (#27705)
1 parent 61f1434 commit e4ebce3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ydb/core/fq/libs/row_dispatcher/format_handler/filters/purecalc_filter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,19 @@ class TProgramRunHandler final : public IProgramRunHandler, public TNonCopyable
432432
static constexpr std::string_view LogPrefix = "GenerateSql: ";
433433

434434
const auto& settings = consumer-> GetPurecalcSettings();
435-
const auto& filterExpr = consumer->GetFilterExpr();
435+
auto filterExpr = TStringBuf(consumer->GetFilterExpr());
436436
const auto& watermarkExpr = consumer->GetWatermarkExpr();
437437

438438
if (!filterExpr && !watermarkExpr) {
439439
LOG_ROW_DISPATCHER_TRACE("No sql was generated");
440440
return {};
441441
}
442442

443+
constexpr auto wherePrefix = "WHERE "sv;
444+
if (filterExpr.starts_with(wherePrefix)) { // workaround for YQ-4827
445+
filterExpr.remove_prefix(wherePrefix.size());
446+
}
447+
443448
using namespace fmt::literals;
444449
auto result = fmt::format(
445450
R"sql(

ydb/core/fq/libs/row_dispatcher/format_handler/ut/topic_filter_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ Y_UNIT_TEST_SUITE(TestPurecalcFilter) {
329329
auto consumer = MakeConsumer(
330330
{{"a1", "[DataType; String]"}, {"a2", "[DataType; Uint64]"}, {"a@3", "[OptionalType; [DataType; String]]"}},
331331
"",
332-
"a2 > 100",
332+
"WHERE a2 > 100", // combined test for backward compatibility YQ-4827
333333
[&](ui64 offset, bool filter, TMaybe<ui64> watermark) {
334334
offsets.push_back(offset);
335335
filters.push_back(filter);

0 commit comments

Comments
 (0)