OmniSciDB  8fa3bf436f
 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)
 

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 3175 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().

3177  {
3178  const auto& table_name = shared_dict_def.get_foreign_table();
3179  const auto td = cat.getMetadataForTable(table_name);
3180  CHECK(td);
3181  const auto& foreign_col_name = shared_dict_def.get_foreign_column();
3182  return cat.getMetadataForColumn(td->tableId, foreign_col_name);
3183 }
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:203

+ 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 2186 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().

2186  {
2187  auto timing_type_entry =
2189  CHECK(timing_type_entry != foreign_table.options.end());
2190  if (timing_type_entry->second ==
2192  return foreign_storage::get_next_refresh_time(foreign_table.options);
2193  }
2195 }
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:42
#define CHECK(condition)
Definition: Logger.h:203
static constexpr int NULL_REFRESH_TIME
Definition: ForeignTable.h:51
static constexpr const char * SCHEDULE_REFRESH_TIMING_TYPE
Definition: ForeignTable.h:49

+ 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 911 of file Catalog.cpp.

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

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

911  {
912  UserMetadata user;
913  if (SysCatalog::instance().getMetadataForUserById(id, user)) {
914  return user.userName;
915  }
916  // a user could be deleted and a dashboard still exist?
917  return "Unknown";
918 }

+ 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 3089 of file Catalog.cpp.

References to_string().

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

3089  {
3090  std::string table_epochs_str{"["};
3091  bool first_entry{true};
3092  for (const auto& table_epoch : table_epochs) {
3093  if (first_entry) {
3094  first_entry = false;
3095  } else {
3096  table_epochs_str += ", ";
3097  }
3098  table_epochs_str += "(table_id: " + std::to_string(table_epoch.table_id) +
3099  ", epoch: " + std::to_string(table_epoch.table_epoch) + ")";
3100  }
3101  table_epochs_str += "]";
3102  return table_epochs_str;
3103 }
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 154 of file Catalog.cpp.

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

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

+ Here is the caller graph for this function: