Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,18 @@ class TProgramRunHandler final : public IProgramRunHandler, public TNonCopyable
static constexpr std::string_view LogPrefix = "GenerateSql: ";

const auto& settings = consumer-> GetPurecalcSettings();
const auto& filterExpr = consumer->GetFilterExpr();
auto filterExpr = TStringBuf(consumer->GetFilterExpr());
const auto& watermarkExpr = consumer->GetWatermarkExpr();

if (!filterExpr && !watermarkExpr) {
LOG_ROW_DISPATCHER_TRACE("No sql was generated");
return {};
}

if (filterExpr.starts_with("WHERE "sv)) { // workaround for YQ-4827
filterExpr = filterExpr.substr("WHERE "sv.size());
}

using namespace fmt::literals;
auto result = fmt::format(
R"sql(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ Y_UNIT_TEST_SUITE(TestPurecalcFilter) {
auto consumer = MakeConsumer(
{{"a1", "[DataType; String]"}, {"a2", "[DataType; Uint64]"}, {"a@3", "[OptionalType; [DataType; String]]"}},
"",
"a2 > 100",
"WHERE a2 > 100", // combined test for backward compatibility YQ-4827
[&](ui64 offset, bool filter, TMaybe<ui64> watermark) {
offsets.push_back(offset);
filters.push_back(filter);
Expand Down
Loading