OmniSciDB  343343d194
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ComputeMetadataTest.cpp} Namespace Reference

Functions

void run_ddl_statement (const std::string &stmt)
 
std::shared_ptr< ResultSetrun_multiple_agg (const std::string &query_str, const ExecutorDeviceType device_type)
 
template<typename T , typename... Args>
void check_column_metadata_impl (const std::map< int, ChunkMetadata > &metadata_map, const int column_idx, const T min, const T max, const bool has_nulls)
 
template<typename T , typename... Args>
void check_column_metadata_impl (const std::map< int, ChunkMetadata > &metadata_map, const int column_idx, const T min, const T max, const bool has_nulls, Args &&...args)
 
template<typename... Args>
auto check_fragment_metadata (Args &&...args) -> auto
 
template<typename FUNC , typename... Args>
void run_op_per_fragment (const TableDescriptor *td, FUNC f, Args &&...args)
 
template<typename FUNC , typename... Args, std::size_t... Is>
void run_op_per_fragment (const TableDescriptor *td, FUNC f, std::tuple< Args...> tuple, std::index_sequence< Is...>)
 
template<typename FUNC , typename... Args>
void run_op_per_fragment (const TableDescriptor *td, std::tuple< FUNC, std::tuple< Args...>> tuple)
 
void recompute_metadata (const TableDescriptor *td, const Catalog_Namespace::Catalog &cat)
 
void vacuum_and_recompute_metadata (const TableDescriptor *td, const Catalog_Namespace::Catalog &cat)
 

Variables

template<typename... Args>
auto check_column_metadata
 
static const std::string g_table_name {"metadata_test"}
 

Function Documentation

template<typename T , typename... Args>
void anonymous_namespace{ComputeMetadataTest.cpp}::check_column_metadata_impl ( const std::map< int, ChunkMetadata > &  metadata_map,
const int  column_idx,
const T  min,
const T  max,
const bool  has_nulls 
)

Definition at line 66 of file ComputeMetadataTest.cpp.

References CHECK.

Referenced by check_column_metadata_impl().

70  {
71  auto chunk_metadata_itr = metadata_map.find(column_idx);
72  if (column_idx < 0) {
73  chunk_metadata_itr--;
74  }
75  CHECK(chunk_metadata_itr != metadata_map.end());
76  const auto& chunk_metadata = chunk_metadata_itr->second;
77  assert_metadata<T>(chunk_metadata.chunkStats, min, max, has_nulls);
78 }
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the caller graph for this function:

template<typename T , typename... Args>
void anonymous_namespace{ComputeMetadataTest.cpp}::check_column_metadata_impl ( const std::map< int, ChunkMetadata > &  metadata_map,
const int  column_idx,
const T  min,
const T  max,
const bool  has_nulls,
Args &&...  args 
)

Definition at line 81 of file ComputeMetadataTest.cpp.

References run-benchmark-import::args, check_column_metadata_impl(), and run-benchmark-import::type.

86  {
87  check_column_metadata_impl(metadata_map, column_idx, min, max, has_nulls);
88  using T1 = typename std::tuple_element<1, std::tuple<Args...>>::type;
89  check_column_metadata_impl<T1>(metadata_map, std::forward<Args>(args)...);
90 }
void check_column_metadata_impl(const std::map< int, ChunkMetadata > &metadata_map, const int column_idx, const T min, const T max, const bool has_nulls)

+ Here is the call graph for this function:

template<typename... Args>
auto anonymous_namespace{ComputeMetadataTest.cpp}::check_fragment_metadata ( Args &&...  args) -> auto

Definition at line 101 of file ComputeMetadataTest.cpp.

References run-benchmark-import::args.

Referenced by BODY_F().

101  {
102  static_assert(sizeof...(Args) % 4 == 0,
103  "check_fragment_metadata expects arguments to be a multiple of 4");
104  return std::make_tuple(check_column_metadata<Args...>,
105  std::make_tuple<Args...>(std::move(args)...));
106 }

+ Here is the caller graph for this function:

void anonymous_namespace{ComputeMetadataTest.cpp}::recompute_metadata ( const TableDescriptor td,
const Catalog_Namespace::Catalog cat 
)

Definition at line 136 of file ComputeMetadataTest.cpp.

References Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::Catalog::getCurrentDB(), and Executor::getExecutor().

Referenced by BODY_F(), and TEST_F().

137  {
138  auto executor = Executor::getExecutor(cat.getCurrentDB().dbId);
139  TableOptimizer optimizer(td, executor.get(), cat);
140  EXPECT_NO_THROW(optimizer.recomputeMetadata());
141 }
static std::shared_ptr< Executor > getExecutor(const int db_id, const std::string &debug_dir="", const std::string &debug_file="", const MapDParameters mapd_parameters=MapDParameters(),::QueryRenderer::QueryRenderManager *render_manager=nullptr)
Definition: Execute.cpp:123
Driver for running cleanup processes on a table. TableOptimizer provides functions for various cleanu...
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:176

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{ComputeMetadataTest.cpp}::run_ddl_statement ( const std::string &  stmt)
inline

Definition at line 36 of file ComputeMetadataTest.cpp.

References QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runDDLStatement().

36  {
37  QR::get()->runDDLStatement(stmt);
38 }
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:118

+ Here is the call graph for this function:

std::shared_ptr<ResultSet> anonymous_namespace{ComputeMetadataTest.cpp}::run_multiple_agg ( const std::string &  query_str,
const ExecutorDeviceType  device_type 
)

Definition at line 40 of file ComputeMetadataTest.cpp.

References QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runSQL().

41  {
42  return QR::get()->runSQL(query_str, device_type, false, false);
43 }
virtual std::shared_ptr< ResultSet > runSQL(const std::string &query_str, const ExecutorDeviceType device_type, const bool hoist_literals=true, const bool allow_loop_joins=true)
static QueryRunner * get()
Definition: QueryRunner.h:118

+ Here is the call graph for this function:

template<typename FUNC , typename... Args>
void anonymous_namespace{ComputeMetadataTest.cpp}::run_op_per_fragment ( const TableDescriptor td,
FUNC  f,
Args &&...  args 
)

Definition at line 109 of file ComputeMetadataTest.cpp.

References run-benchmark-import::args, CHECK, QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::getCatalog().

Referenced by BODY_F(), run_op_per_fragment(), and TEST_F().

109  {
110  const auto shards = QR::get()->getCatalog()->getPhysicalTablesDescriptors(td);
111  for (const auto shard : shards) {
112  auto* fragmenter = shard->fragmenter;
113  CHECK(fragmenter);
114  const auto table_info = fragmenter->getFragmentsForQuery();
115  for (const auto& fragment : table_info.fragments) {
116  f(fragment, std::forward<Args>(args)...);
117  }
118  }
119 }
static QueryRunner * get()
Definition: QueryRunner.h:118
#define CHECK(condition)
Definition: Logger.h:187
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename FUNC , typename... Args, std::size_t... Is>
void anonymous_namespace{ComputeMetadataTest.cpp}::run_op_per_fragment ( const TableDescriptor td,
FUNC  f,
std::tuple< Args...>  tuple,
std::index_sequence< Is...>   
)

Definition at line 122 of file ComputeMetadataTest.cpp.

References run_op_per_fragment().

125  {
126  run_op_per_fragment(td, f, std::forward<Args>(std::get<Is>(tuple))...);
127 }
void run_op_per_fragment(const TableDescriptor *td, FUNC f, Args &&...args)

+ Here is the call graph for this function:

template<typename FUNC , typename... Args>
void anonymous_namespace{ComputeMetadataTest.cpp}::run_op_per_fragment ( const TableDescriptor td,
std::tuple< FUNC, std::tuple< Args...>>  tuple 
)

Definition at line 130 of file ComputeMetadataTest.cpp.

References run_op_per_fragment().

131  {
133  td, std::get<0>(tuple), std::get<1>(tuple), std::index_sequence_for<Args...>{});
134 }
void run_op_per_fragment(const TableDescriptor *td, FUNC f, Args &&...args)

+ Here is the call graph for this function:

void anonymous_namespace{ComputeMetadataTest.cpp}::vacuum_and_recompute_metadata ( const TableDescriptor td,
const Catalog_Namespace::Catalog cat 
)

Definition at line 143 of file ComputeMetadataTest.cpp.

References Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::Catalog::getCurrentDB(), and Executor::getExecutor().

Referenced by BODY_F().

144  {
145  auto executor = Executor::getExecutor(cat.getCurrentDB().dbId);
146  TableOptimizer optimizer(td, executor.get(), cat);
147  EXPECT_NO_THROW(optimizer.vacuumDeletedRows());
148  EXPECT_NO_THROW(optimizer.recomputeMetadata());
149 }
static std::shared_ptr< Executor > getExecutor(const int db_id, const std::string &debug_dir="", const std::string &debug_file="", const MapDParameters mapd_parameters=MapDParameters(),::QueryRenderer::QueryRenderManager *render_manager=nullptr)
Definition: Execute.cpp:123
Driver for running cleanup processes on a table. TableOptimizer provides functions for various cleanu...
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:176

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

template<typename... Args>
auto anonymous_namespace{ComputeMetadataTest.cpp}::check_column_metadata
Initial value:
=
[](const Fragmenter_Namespace::FragmentInfo& fragment, Args&&... args) {
const auto metadata_map = fragment.getChunkMetadataMapPhysical();
using T = typename std::tuple_element<1, std::tuple<Args...>>::type;
check_column_metadata_impl<T>(metadata_map, std::forward<Args>(args)...);
}
Used by Fragmenter classes to store info about each fragment - the fragment id and number of tuples(r...
Definition: Fragmenter.h:79
const std::map< int, ChunkMetadata > & getChunkMetadataMapPhysical() const
Definition: Fragmenter.h:102

Definition at line 93 of file ComputeMetadataTest.cpp.

const std::string anonymous_namespace{ComputeMetadataTest.cpp}::g_table_name {"metadata_test"}
static