Skip to content

Commit fd2d747

Browse files
authored
Fix Bytes stats - adjust according to number of columns used (S3) (#6910)
1 parent 991079d commit fd2d747

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ydb/core/kqp/opt/kqp_statistics_transformer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ void InferStatisticsForDqSourceWrap(const TExprNode::TPtr& input, TTypeAnnotatio
316316
}
317317
}
318318
if (stats->ByteSize != 0.0) {
319+
if (stats->Ncols) {
320+
auto n = wrapBase.Cast().RowType().Ref().GetTypeAnn()->Cast<TTypeExprType>()->GetType()->Cast<TStructExprType>()->GetSize();
321+
stats->ByteSize = stats->ByteSize * n / stats->Ncols;
322+
}
319323
YQL_CLOG(TRACE, CoreDq) << "Infer statistics for s3 data source " << path;
320324
typeCtx->SetStats(input.Get(), stats);
321325
typeCtx->SetStats(s3DataSource.Raw(), stats);

0 commit comments

Comments
 (0)