Ejemplo n.º 1
0
Column *ColumnManager::AddExprColumn(common::Type::TypeId type, int size, std::string name,
                                     bool inlined) {
  LOG_TRACE("Adding expr column: %s, type %d, size %d, inlined %s",
            name.c_str(), type, size,
            inlined ? "yes" : "no");
  Column *col = new ExprColumn(next_column_id++, type, size, name, inlined);

  id_to_column.insert(std::pair<ColumnID, Column *>(col->ID(), col));
  columns.push_back(col);
  return col;
}
Ejemplo n.º 2
0
Column *ColumnManager::AddBaseColumn(common::Type::TypeId type, int size, std::string name,
                                     bool inlined, oid_t base_table,
                                     oid_t column_index) {
  LOG_TRACE(
      "Adding base column: %s, type %d, size %d, inlined %s, "
      "table %u, col %u",
      name.c_str(), type, size,
      inlined ? "yes" : "no", base_table, column_index);
  Column *col = new TableColumn(next_column_id++, type, size, name, inlined,
                                base_table, column_index);

  auto key = std::make_tuple(base_table, column_index);
  table_col_index_to_column.insert(
      std::pair<decltype(key), Column *>(key, col));
  id_to_column.insert(std::pair<ColumnID, Column *>(col->ID(), col));
  columns.push_back(col);
  return col;
}