@@ -269,21 +269,35 @@ public static TrieBackedPartition create(DecoratedKey partitionKey,
269269 : new WithEnsureOnHeap (partitionKey , columnMetadata , encodingStats , rowCountIncludingStatic , tombstoneCount , trie , metadata , ensureOnHeap );
270270 }
271271
272- class RowIterator extends TrieEntriesIterator <Object , Row >
272+ class RowIterator extends TrieEntriesIterator . WithNullFiltering <Object , Row >
273273 {
274274 public RowIterator (DeletionAwareTrie <Object , TrieTombstoneMarker > trie , Direction direction )
275275 {
276- super (trie .contentOnlyTrie ( ), direction , RowData . class :: isInstance );
276+ super (trie .mergedTrie ( TrieBackedPartition :: combineDataAndDeletion ), direction );
277277 }
278278
279279 @ Override
280280 protected Row mapContent (Object content , byte [] bytes , int byteLength )
281281 {
282- var rd = (RowData ) content ;
283- return toRow (rd ,
284- metadata .comparator .clusteringFromByteComparable (
285- ByteBufferAccessor .instance ,
286- ByteComparable .preencoded (BYTE_COMPARABLE_VERSION , bytes , 0 , byteLength )));
282+ if (content instanceof RowData )
283+ return toRow ((RowData ) content ,
284+ getClustering (bytes , byteLength ));
285+ if (content instanceof Row )
286+ {
287+ BTreeRow row = (BTreeRow ) content ;
288+ return BTreeRow .create (getClustering (bytes , byteLength ),
289+ row .primaryKeyLivenessInfo (),
290+ row .deletion (),
291+ row .getBTree (),
292+ row .getMinLocalDeletionTime ());
293+ }
294+
295+ TrieTombstoneMarker marker = (TrieTombstoneMarker ) content ;
296+ if (marker .hasPointData ())
297+ return BTreeRow .emptyDeletedRow (getClustering (bytes , byteLength ),
298+ Row .Deletion .regular (marker .deletionTime ()));
299+ else
300+ return null ;
287301 }
288302 }
289303
@@ -513,6 +527,14 @@ public static Object combineDataAndDeletion(Object data, TrieTombstoneMarker del
513527 return rowData .toRow (Clustering .EMPTY , deletion .deletionTime ());
514528 }
515529
530+ private Clustering <?> getClustering (byte [] bytes , int byteLength )
531+ {
532+ return metadata .comparator .clusteringFromByteComparable (ByteBufferAccessor .instance ,
533+ ByteComparable .preencoded (BYTE_COMPARABLE_VERSION ,
534+ bytes , 0 , byteLength ),
535+ BYTE_COMPARABLE_VERSION );
536+ }
537+
516538 /// Implementation of [UnfilteredRowIterator] for this partition.
517539 ///
518540 /// Currently, this implementation is pretty involved because it has to revert the transformations done to row and
@@ -573,14 +595,6 @@ protected Unfiltered mapContent(Object content, byte[] bytes, int byteLength)
573595 partitionLevelDeletion );
574596 }
575597
576- private Clustering <?> getClustering (byte [] bytes , int byteLength )
577- {
578- return metadata .comparator .clusteringFromByteComparable (ByteBufferAccessor .instance ,
579- ByteComparable .preencoded (BYTE_COMPARABLE_VERSION ,
580- bytes , 0 , byteLength ),
581- BYTE_COMPARABLE_VERSION );
582- }
583-
584598 @ Override
585599 public DeletionTime partitionLevelDeletion ()
586600 {
@@ -608,7 +622,7 @@ public boolean isReverseOrder()
608622 @ Override
609623 public RegularAndStaticColumns columns ()
610624 {
611- return columns ;
625+ return selection . fetchedColumns () ;
612626 }
613627
614628 @ Override
0 commit comments