Skip to content

Commit 02b13bc

Browse files
authored
Combine chunks in result to fix output error (#26672) (#26785)
2 parents 521f690 + 0b164cd commit 02b13bc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ydb/core/protos/config.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,7 @@ message TColumnShardConfig {
19571957
optional bool OnlyBulkUpsertWritingBuffer = 50 [default = true];
19581958
optional uint64 BadPortionSizeLimit = 51 [default = 524288];
19591959
optional uint64 BadPortionsLimit = 52;
1960+
optional bool CombineChunksInResult = 54 [default = true];
19601961
}
19611962

19621963
message TSchemeShardConfig {

ydb/core/tx/columnshard/engines/reader/actor/actor.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,15 @@ bool TColumnShardScan::SendResult(bool pageFault, bool lastBatch) {
412412
Result->WaitTime = WaitTime;
413413
Result->RawBytes = ScanCountersPool.GetRawBytes();
414414

415+
if (AppDataVerified().ColumnShardConfig.GetCombineChunksInResult() && Result->ArrowBatch) {
416+
for (const auto& column : Result->ArrowBatch->columns()) {
417+
if (column->num_chunks() > 1) {
418+
Result->ArrowBatch = Result->ArrowBatch->CombineChunks().ValueOr(Result->ArrowBatch);
419+
break;
420+
}
421+
}
422+
}
423+
415424
LWPROBE(SendResult, TabletId, ScanId, TxId, Result->GetRowsCount(), (Result->ArrowBatch ? NArrow::GetTableDataSize(Result->ArrowBatch) : 0), Result->CpuTime, Result->WaitTime, TInstant::Now() - LastSend, Result->Finished);
416425
Send(ScanComputeActorId, Result.Release(), IEventHandle::FlagTrackDelivery); // TODO: FlagSubscribeOnSession ?
417426
LastSend = TInstant::Now();

0 commit comments

Comments
 (0)