@@ -73,8 +73,8 @@ TColumnShardScan::TColumnShardScan(const TActorId& columnShardActorId, const TAc
73
73
}
74
74
75
75
void TColumnShardScan::Bootstrap (const TActorContext& ctx) {
76
- // TLogContextGuard gLogging(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD_SCAN) ("SelfId", SelfId())(
77
- // "TabletId", TabletId)("ScanId", ScanId)("TxId", TxId)("ScanGen", ScanGen));
76
+ // TLogContextGuard gLogging(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD_SCAN) ("SelfId", SelfId())(
77
+ // "TabletId", TabletId)("ScanId", ScanId)("TxId", TxId)("ScanGen", ScanGen));
78
78
auto g = Stats->MakeGuard (" bootstrap" );
79
79
ScanActorId = ctx.SelfID ;
80
80
@@ -263,16 +263,18 @@ bool TColumnShardScan::ProduceResults() noexcept {
263
263
" batch_columns" , JoinSeq (" ," , batch->schema ()->field_names ()));
264
264
}
265
265
if (CurrentLastReadKey) {
266
- NArrow::NMerger::TSortableBatchPosition pNew (result.GetScanCursor ()->GetPKCursor (), 0 ,
267
- result.GetScanCursor ()->GetPKCursor ()->schema ()->field_names (), {}, ReadMetadataRange->IsDescSorted ());
268
- NArrow::NMerger::TSortableBatchPosition pOld (CurrentLastReadKey->GetPKCursor (), 0 ,
269
- CurrentLastReadKey->GetPKCursor ()->schema ()->field_names (), {}, ReadMetadataRange->IsDescSorted ());
270
- AFL_VERIFY (!(pNew < pOld))(" old" , pOld.DebugJson ().GetStringRobust ())(" new" , pNew.DebugJson ().GetStringRobust ());
266
+ auto pNew = NArrow::TReplaceKey::FromBatch (result.GetScanCursor ()->GetPKCursor (), 0 );
267
+ auto pOld = NArrow::TReplaceKey::FromBatch (CurrentLastReadKey->GetPKCursor (), 0 );
268
+ if (!ReadMetadataRange->IsDescSorted ()) {
269
+ AFL_VERIFY (!(pNew < pOld))(" old" , pOld.DebugJson ().GetStringRobust ())(" new" , pNew.DebugJson ().GetStringRobust ());
270
+ } else {
271
+ AFL_VERIFY (!(pOld < pNew))(" old" , pOld.DebugJson ().GetStringRobust ())(" new" , pNew.DebugJson ().GetStringRobust ());
272
+ }
271
273
}
272
274
CurrentLastReadKey = result.GetScanCursor ();
273
275
274
- Result->LastKey = ConvertLastKey (result. GetScanCursor () ->GetPKCursor ());
275
- Result->LastCursorProto = result. GetScanCursor () ->SerializeToProto ();
276
+ Result->LastKey = ConvertLastKey (CurrentLastReadKey ->GetPKCursor ());
277
+ Result->LastCursorProto = CurrentLastReadKey ->SerializeToProto ();
276
278
SendResult (false , false );
277
279
ScanIterator->OnSentDataFromInterval (result.GetNotFinishedIntervalIdx ());
278
280
ACFL_DEBUG (" stage" , " finished" )(" iterator" , ScanIterator->DebugString ());
@@ -313,8 +315,8 @@ void TColumnShardScan::ContinueProcessing() {
313
315
}
314
316
}
315
317
AFL_VERIFY (!ScanIterator || !ChunksLimiter.HasMore () || ScanCountersPool.InWaiting ())(" scan_actor_id" , ScanActorId)(" tx_id" , TxId)(
316
- " scan_id" , ScanId)(" gen" , ScanGen)(" tablet" , TabletId)(" debug " ,
317
- ScanIterator->DebugString ())(" counters" , ScanCountersPool.DebugString ());
318
+ " scan_id" , ScanId)(" gen" , ScanGen)(" tablet" , TabletId)(
319
+ " debug " , ScanIterator->DebugString ())(" counters" , ScanCountersPool.DebugString ());
318
320
}
319
321
320
322
void TColumnShardScan::MakeResult (size_t reserveRows /* = 0*/ ) {
0 commit comments