@@ -65,24 +65,24 @@ ColumnFileReaderPtr ColumnFileInMemory::getReader(
6565 return std::make_shared<ColumnFileInMemoryReader>(*this , col_defs);
6666}
6767
68- bool ColumnFileInMemory::append (
68+ ColumnFile::AppendResult ColumnFileInMemory::append (
6969 const DMContext & context,
7070 const Block & data,
7171 size_t offset,
7272 size_t limit,
7373 size_t data_bytes)
7474{
7575 if (disable_append)
76- return false ;
76+ return AppendResult{ false , 0 } ;
7777
7878 std::scoped_lock lock (cache->mutex );
7979 if (!isSameSchema (cache->block , data))
80- return false ;
80+ return AppendResult{ false , 0 } ;
8181
8282 // check whether this instance overflows
8383 if (cache->block .rows () >= context.delta_cache_limit_rows
8484 || cache->block .bytes () >= context.delta_cache_limit_bytes )
85- return false ;
85+ return AppendResult{ false , 0 } ;
8686
8787 size_t new_alloc_block_bytes = 0 ;
8888 size_t max_capacity = 0 ;
@@ -97,8 +97,8 @@ bool ColumnFileInMemory::append(
9797 // If the column is not enough, we reserve more space by 1.5 factor
9898 mutable_cache_col->reserveWithStrategy (mutable_cache_col->size () + limit, IColumn::ReserveStrategy::ScaleFactor1_5);
9999 }
100- max_capacity = std::max (max_capacity, mutable_cache_col->capacity ());
101100 mutable_cache_col->insertRangeFrom (*col, offset, limit);
101+ max_capacity = std::max (max_capacity, mutable_cache_col->capacity ());
102102 new_alloc_block_bytes += mutable_cache_col->allocatedBytes () - alloc_bytes;
103103 }
104104
@@ -113,7 +113,7 @@ bool ColumnFileInMemory::append(
113113 max_capacity,
114114 rows,
115115 bytes);
116- return true ;
116+ return AppendResult{ true , new_alloc_block_bytes} ;
117117}
118118
119119Block ColumnFileInMemory::readDataForFlush () const
0 commit comments