OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Catalog_Namespace::anonymous_namespace{Catalog.cpp} Namespace Reference

Functions

auto table_json_filepath (const std::string &base_path, const std::string &db_name)
 
std::string getUserFromId (const int32_t id)
 
int64_t get_next_refresh_time (const foreign_storage::ForeignTable &foreign_table)
 
std::string table_epochs_to_string (const std::vector< TableEpochInfo > &table_epochs)
 
const ColumnDescriptorget_foreign_col (const Catalog &cat, const Parser::SharedDictionaryDef &shared_dict_def)
 
void unserialize_key_metainfo (std::vector< std::string > &shared_dicts, std::set< std::string > &shared_dict_column_names, const std::string keyMetainfo)
 

Function Documentation

const ColumnDescriptor* Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_foreign_col ( const Catalog &  cat,
const Parser::SharedDictionaryDef shared_dict_def 
)

Definition at line 2969 of file Catalog.cpp.

References CHECK, Parser::SharedDictionaryDef::get_foreign_column(), Parser::SharedDictionaryDef::get_foreign_table(), Catalog_Namespace::Catalog::getMetadataForColumn(), Catalog_Namespace::Catalog::getMetadataForTable(), and TableDescriptor::tableId.

Referenced by Catalog_Namespace::Catalog::addReferenceToForeignDict().

2971  {
2972  const auto& table_name = shared_dict_def.get_foreign_table();
2973  const auto td = cat.getMetadataForTable(table_name);
2974  CHECK(td);
2975  const auto& foreign_col_name = shared_dict_def.get_foreign_column();
2976  return cat.getMetadataForColumn(td->tableId, foreign_col_name);
2977 }
std::string cat(Ts &&...args)
const std::string & get_foreign_table() const
Definition: ParserNode.h:903
const std::string & get_foreign_column() const
Definition: ParserNode.h:905
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time ( const foreign_storage::ForeignTable foreign_table)

Definition at line 2144 of file Catalog.cpp.

References CHECK, foreign_storage::get_next_refresh_time(), foreign_storage::ForeignTable::NULL_REFRESH_TIME, foreign_storage::OptionsContainer::options, foreign_storage::ForeignTable::REFRESH_TIMING_TYPE_KEY, and foreign_storage::ForeignTable::SCHEDULE_REFRESH_TIMING_TYPE.

Referenced by Catalog_Namespace::Catalog::createTable(), and Catalog_Namespace::Catalog::updateForeignTableRefreshTimes().

2144  {
2145  auto timing_type_entry =
2147  CHECK(timing_type_entry != foreign_table.options.end());
2148  if (timing_type_entry->second ==
2150  return foreign_storage::get_next_refresh_time(foreign_table.options);
2151  }
2153 }
int64_t get_next_refresh_time(const std::map< std::string, std::string, std::less<>> &foreign_table_options)
static constexpr const char * REFRESH_TIMING_TYPE_KEY
Definition: ForeignTable.h:52
#define CHECK(condition)
Definition: Logger.h:197
static constexpr int NULL_REFRESH_TIME
Definition: ForeignTable.h:61
static constexpr const char * SCHEDULE_REFRESH_TIMING_TYPE
Definition: ForeignTable.h:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string Catalog_Namespace::anonymous_namespace{Catalog.cpp}::getUserFromId ( const int32_t  id)

Definition at line 918 of file Catalog.cpp.

References Catalog_Namespace::SysCatalog::instance(), and Catalog_Namespace::UserMetadata::userName.

Referenced by Catalog_Namespace::Catalog::buildMaps().

918  {
919  UserMetadata user;
920  if (SysCatalog::instance().getMetadataForUserById(id, user)) {
921  return user.userName;
922  }
923  // a user could be deleted and a dashboard still exist?
924  return "Unknown";
925 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_epochs_to_string ( const std::vector< TableEpochInfo > &  table_epochs)

Definition at line 2860 of file Catalog.cpp.

References to_string().

Referenced by Catalog_Namespace::Catalog::setTableEpochsLogExceptions().

2860  {
2861  std::string table_epochs_str{"["};
2862  bool first_entry{true};
2863  for (const auto& table_epoch : table_epochs) {
2864  if (first_entry) {
2865  first_entry = false;
2866  } else {
2867  table_epochs_str += ", ";
2868  }
2869  table_epochs_str += "(table_id: " + std::to_string(table_epoch.table_id) +
2870  ", epoch: " + std::to_string(table_epoch.table_epoch) + ")";
2871  }
2872  table_epochs_str += "]";
2873  return table_epochs_str;
2874 }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

auto Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_json_filepath ( const std::string &  base_path,
const std::string &  db_name 
)
inline

Definition at line 153 of file Catalog.cpp.

Referenced by Catalog_Namespace::Catalog::Catalog(), Catalog_Namespace::Catalog::dropTableFromJsonUnlocked(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), and Catalog_Namespace::Catalog::~Catalog().

154  {
155  return boost::filesystem::path(base_path + "/mapd_catalogs/" + db_name +
156  "_temp_tables.json");
157 }

+ Here is the caller graph for this function:

void Catalog_Namespace::anonymous_namespace{Catalog.cpp}::unserialize_key_metainfo ( std::vector< std::string > &  shared_dicts,
std::set< std::string > &  shared_dict_column_names,
const std::string  keyMetainfo 
)

Definition at line 4161 of file Catalog.cpp.

References CHECK, Catalog_Namespace::Catalog::name(), and run_benchmark_import::type.

Referenced by Catalog_Namespace::Catalog::dumpCreateTable().

4163  {
4164  rapidjson::Document document;
4165  document.Parse(keyMetainfo.c_str());
4166  CHECK(!document.HasParseError());
4167  CHECK(document.IsArray());
4168  for (auto it = document.Begin(); it != document.End(); ++it) {
4169  const auto& key_with_spec_json = *it;
4170  CHECK(key_with_spec_json.IsObject());
4171  const std::string type = key_with_spec_json["type"].GetString();
4172  const std::string name = key_with_spec_json["name"].GetString();
4173  auto key_with_spec = type + " (" + name + ")";
4174  if (type == "SHARED DICTIONARY") {
4175  shared_dict_column_names.insert(name);
4176  key_with_spec += " REFERENCES ";
4177  const std::string foreign_table = key_with_spec_json["foreign_table"].GetString();
4178  const std::string foreign_column = key_with_spec_json["foreign_column"].GetString();
4179  key_with_spec += foreign_table + "(" + foreign_column + ")";
4180  } else {
4181  CHECK(type == "SHARD KEY");
4182  }
4183  shared_dicts.push_back(key_with_spec);
4184  }
4185 }
#define CHECK(condition)
Definition: Logger.h:197
string name
Definition: setup.py:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function: