Skip to content

Commit 19e15f7

Browse files
authored
[yt provider] Force transform merge if different column group settings (#7925)
1 parent 7b528af commit 19e15f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,16 @@ class TYtNativeGateway : public IYtGateway {
32043204
bool combineChunks = NYql::HasSetting(merge.Settings().Ref(), EYtSettingType::CombineChunks);
32053205
TMaybe<ui64> limit = GetLimit(merge.Settings().Ref());
32063206

3207+
const auto cluster = merge.DataSink().Cluster().StringValue();
3208+
const bool hasOutGroup = !execCtx->OutTables_.front().ColumnGroups.IsUndefined();
3209+
const bool lookup = execCtx->Options_.Config()->OptimizeFor.Get(cluster).GetOrElse(NYT::OF_LOOKUP_ATTR) == NYT::OF_LOOKUP_ATTR;
3210+
const bool enabledColGroup = execCtx->Options_.Config()->ColumnGroupMode.Get().GetOrElse(EColumnGroupMode::Disable) != EColumnGroupMode::Disable;
3211+
const bool hasNonTmpInput = !AllOf(execCtx->InputTables_, [](const auto& table) { return table.Temp; });
3212+
3213+
forceTransform = forceTransform
3214+
|| (!lookup && enabledColGroup != hasOutGroup)
3215+
|| (!lookup && hasOutGroup && hasNonTmpInput);
3216+
32073217
return execCtx->Session_->Queue_->Async([forceTransform, combineChunks, limit, execCtx]() {
32083218
return execCtx->LookupQueryCacheAsync().Apply([forceTransform, combineChunks, limit, execCtx] (const auto& f) {
32093219
YQL_LOG_CTX_ROOT_SESSION_SCOPE(execCtx->LogCtx_);

0 commit comments

Comments
 (0)