src/backend/executor/abstract_join_executor.cpp
/**
 * @ brief Build the schema of the joined tile based on the projection info
 */
@ brief Build the schema of the joined tile based on the projection info
@ brief Build the schema of the joined tile based on the projection info
std::vector<LogicalTile::ColumnInfo> AbstractJoinExecutor::BuildSchema(
    std::vector<LogicalTile::ColumnInfo> &left,
    std::vector<LogicalTile::ColumnInfo> &right) {
  std::vector<LogicalTile::ColumnInfo> schema;
  if (proj_info_ == nullptr) {
    schema.assign(left.begin(), left.end());
    schema.insert(schema.end(), right.begin(), right.end());
  } else {
    assert(!proj_info_->isNonTrivial());
    auto &direct_map_list = proj_info_->GetDirectMapList();
    schema.resize(direct_map_list.size());
    LOG_INFO("left size: %lu, right size: %lu", left.size(), right.size());
    LOG_INFO("Projection: %s", proj_info_->Debug().c_str());
    for (auto &entry : direct_map_list) {
      if (entry.second.first == 0) {
        assert(entry.second.second < left.size());
        schema[entry.first] = left[entry.second.second];
      } else {
        assert(entry.second.second < right.size());
        schema[entry.first] = right[entry.second.second];
      }
    }
  }
  return schema;
}
std :: vector < LogicalTile :: ColumnInfo > AbstractJoinExecutor :: BuildSchema ( std :: vector < LogicalTile :: ColumnInfo > & left , std :: vector < LogicalTile :: ColumnInfo > & right ) { std :: vector < LogicalTile :: ColumnInfo > schema ; if ( proj_info_ == nullptr ) { schema . assign ( left . begin ( ) , left . end ( ) ) ; schema . insert ( schema . end ( ) , right . begin ( ) , right . end ( ) ) ; } else { assert ( ! proj_info_ -> isNonTrivial ( ) ) ; auto & direct_map_list = proj_info_ -> GetDirectMapList ( ) ; schema . resize ( direct_map_list . size ( ) ) ; LOG_INFO ( " " , left . size ( ) , right . size ( ) ) ; LOG_INFO ( " " , proj_info_ -> Debug ( ) . c_str ( ) ) ; for ( auto & entry : direct_map_list ) { if ( entry . second . first == 0 ) { assert ( entry . second . second < left . size ( ) ) ; schema [ entry . first ] = left [ entry . second . second ] ; } else { assert ( entry . second . second < right . size ( ) ) ; schema [ entry . first ] = right [ entry . second . second ] ; } } } return schema ; }
@ brief Build the schema of the joined tile based on the projection info
@ brief Build the schema of the joined tile based on the projection info
// no projection