src/backend/storage/data_table.cpp
// Set the transformed tile group column-at-a-time
Set the transformed tile group column-at-a-time
Set the transformed tile group column - at - a - time
void SetTransformedTileGroup(storage::TileGroup *orig_tile_group,
                             storage::TileGroup *new_tile_group) {
  auto new_column_map = new_tile_group->GetColumnMap();
  auto orig_column_map = orig_tile_group->GetColumnMap();
  assert(new_column_map.size() == orig_column_map.size());
  oid_t orig_tile_offset, orig_tile_column_offset;
  oid_t new_tile_offset, new_tile_column_offset;
  auto column_count = new_column_map.size();
  auto tuple_count = orig_tile_group->GetAllocatedTupleCount();
  for (oid_t column_itr = 0; column_itr < column_count; column_itr++) {
    orig_tile_group->LocateTileAndColumn(column_itr, orig_tile_offset,
                                         orig_tile_column_offset);
    new_tile_group->LocateTileAndColumn(column_itr, new_tile_offset,
                                        new_tile_column_offset);
    auto orig_tile = orig_tile_group->GetTile(orig_tile_offset);
    auto new_tile = new_tile_group->GetTile(new_tile_offset);
    for (oid_t tuple_itr = 0; tuple_itr < tuple_count; tuple_itr++) {
      auto val = orig_tile->GetValue(tuple_itr, orig_tile_column_offset);
      new_tile->SetValue(val, tuple_itr, new_tile_column_offset);
    }
  }
  auto header = orig_tile_group->GetHeader();
  auto new_header = new_tile_group->GetHeader();
  *new_header = *header;
}
void SetTransformedTileGroup ( storage :: TileGroup * orig_tile_group , storage :: TileGroup * new_tile_group ) { auto new_column_map = new_tile_group -> GetColumnMap ( ) ; auto orig_column_map = orig_tile_group -> GetColumnMap ( ) ; assert ( new_column_map . size ( ) == orig_column_map . size ( ) ) ; oid_t orig_tile_offset , orig_tile_column_offset ; oid_t new_tile_offset , new_tile_column_offset ; auto column_count = new_column_map . size ( ) ; auto tuple_count = orig_tile_group -> GetAllocatedTupleCount ( ) ; for ( oid_t column_itr = 0 ; column_itr < column_count ; column_itr ++ ) { orig_tile_group -> LocateTileAndColumn ( column_itr , orig_tile_offset , orig_tile_column_offset ) ; new_tile_group -> LocateTileAndColumn ( column_itr , new_tile_offset , new_tile_column_offset ) ; auto orig_tile = orig_tile_group -> GetTile ( orig_tile_offset ) ; auto new_tile = new_tile_group -> GetTile ( new_tile_offset ) ; for ( oid_t tuple_itr = 0 ; tuple_itr < tuple_count ; tuple_itr ++ ) { auto val = orig_tile -> GetValue ( tuple_itr , orig_tile_column_offset ) ; new_tile -> SetValue ( val , tuple_itr , new_tile_column_offset ) ; } } auto header = orig_tile_group -> GetHeader ( ) ; auto new_header = new_tile_group -> GetHeader ( ) ; * new_header = * header ; }
Set the transformed tile group column-at-a-time
Set the transformed tile group column - at - a - time
// Check the schema of the two tile groups // Go over each column copying onto the new tile group // Locate the original base tile and tile column offset // Copy the column over to the new tile group // Finally, copy over the tile header