33 namespace SourceCatalog {
36 template <
typename From>
48 template <
typename From>
53 template <
typename From>
55 throw Elements::Exception() <<
"Only std::string and int64_t are supported types for a source ID, got "
56 <<
typeid(From).name() <<
" instead";
60 CatalogFromTable::CatalogFromTable(
62 const string& source_id_column_name,
66 if (source_id_index_ptr ==
nullptr) {
67 throw Elements::Exception() <<
"Column info does not have the column " << source_id_column_name;
69 m_source_id_index = *(source_id_index_ptr);
71 m_attribute_from_row_ptr_vector =
std::move(
72 attribute_from_row_ptr_vector);
75 CatalogFromTable::~CatalogFromTable() {
88 for (
auto row : input_table) {
90 auto source_id = boost::apply_visitor(castVisitor, row[m_source_id_index]);
94 for (
auto& attribute_from_table_ptr : m_attribute_from_row_ptr_vector) {
96 attribute_from_table_ptr->createAttribute(row));
102 return Catalog { source_vector };