OmniSciDB  04ee39c94c
UpdelStorageTest.cpp File Reference
#include <csignal>
#include <cstdlib>
#include <gtest/gtest.h>
#include <boost/algorithm/string.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include "boost/filesystem.hpp"
#include "Catalog/Catalog.h"
#include "Fragmenter/InsertOrderFragmenter.h"
#include "Import/Importer.h"
#include "Parser/parser.h"
#include "QueryEngine/ResultSet.h"
#include "QueryEngine/TableOptimizer.h"
#include "QueryRunner/QueryRunner.h"
#include "Shared/MapDParameters.h"
#include "Shared/UpdelRoll.h"
#include "Shared/measure.h"
#include "TestHelpers.h"
+ Include dependency graph for UpdelStorageTest.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{UpdelStorageTest.cpp}::UpdelTestConfig
 
struct  anonymous_namespace{UpdelStorageTest.cpp}::ScalarTargetValueExtractor
 
class  anonymous_namespace{UpdelStorageTest.cpp}::RowVacuumTestWithVarlenAndArraysN< N >
 
class  anonymous_namespace{UpdelStorageTest.cpp}::RowVacuumTest
 
class  anonymous_namespace{UpdelStorageTest.cpp}::UpdateStorageTest
 

Namespaces

 anonymous_namespace{UpdelStorageTest.cpp}
 

Macros

#define BASE_PATH   "./tmp"
 
#define update_a_datetime_column   update_a_encoded_string_column
 
#define SQLTypeInfo_dropoff_latitude   SQLTypeInfo(kDECIMAL, 19, 5, false)
 
#define SQLTypeInfo_dropoff_longitude   SQLTypeInfo(kDOUBLE, false)
 
#define SQLTypeInfo_trip_time_in_secs   SQLTypeInfo(kINT, false)
 

Typedefs

using QR = QueryRunner::QueryRunner
 
using anonymous_namespace{UpdelStorageTest.cpp}::ResultRow = std::vector< TargetValue >
 
using anonymous_namespace{UpdelStorageTest.cpp}::ResultRows = std::vector< ResultRow >
 
using anonymous_namespace{UpdelStorageTest.cpp}::RowVacuumTestWithVarlenAndArrays_0 = RowVacuumTestWithVarlenAndArraysN< 0 >
 
using anonymous_namespace{UpdelStorageTest.cpp}::ManualRowVacuumTestWithVarlenAndArrays = RowVacuumTestWithVarlenAndArraysN< varNumRowsByDefault/2 >
 
using anonymous_namespace{UpdelStorageTest.cpp}::RowVacuumTestWithVarlenAndArrays = RowVacuumTestWithVarlenAndArraysN< 0 >
 

Functions

void anonymous_namespace{UpdelStorageTest.cpp}::run_ddl_statement (const std::string &input_str)
 
template<class T >
anonymous_namespace{UpdelStorageTest.cpp}::v (const TargetValue &r)
 
std::shared_ptr< ResultSetanonymous_namespace{UpdelStorageTest.cpp}::run_query (const std::string &query_str)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::compare_agg (const std::string &table, const std::string &column, const int64_t cnt, const double avg)
 
template<typename T >
void anonymous_namespace{UpdelStorageTest.cpp}::update_prepare_offsets_values (const int64_t cnt, const int step, const T val, std::vector< uint64_t > &fragOffsets, std::vector< ScalarTargetValue > &rhsValues)
 
template<typename T >
void anonymous_namespace{UpdelStorageTest.cpp}::update_common (const std::string &table, const std::string &column, const int64_t cnt, const int step, const T &val, const SQLTypeInfo &rhsType, const bool commit=true)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::update_a_numeric_column (const std::string &table, const std::string &column, const int64_t cnt, const int step, const double val, const double avg, const bool commit=true, const bool by_string=false)
 
template<typename T >
bool anonymous_namespace{UpdelStorageTest.cpp}::nullize_a_fixed_encoded_column (const std::string &table, const std::string &column, const int64_t cnt)
 
const ResultRows anonymous_namespace{UpdelStorageTest.cpp}::get_some_rows (const std::string &table, const int limit=10)
 
template<typename T >
TargetValue anonymous_namespace{UpdelStorageTest.cpp}::targetValue (std::true_type, const std::vector< T > &vals)
 
template<typename T >
TargetValue anonymous_namespace{UpdelStorageTest.cpp}::targetValue (std::false_type, const T &val)
 
const std::string anonymous_namespace{UpdelStorageTest.cpp}::dumpv (const TargetValue &tv)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::is_equal (const TargetValue &lhs, const TargetValue &rhs)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::compare_row (const std::string &table, const std::string &column, const ResultRow &oldr, const ResultRow &newr, const TargetValue &val, const bool commit)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::update_a_encoded_string_column (const std::string &table, const std::string &column, const int64_t cnt, const int step, const std::string &val, const bool commit=true)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::update_a_boolean_column (const std::string &table, const std::string &column, const int64_t cnt, const int step, const bool val, const bool commit=true)
 
template<typename T >
bool anonymous_namespace{UpdelStorageTest.cpp}::update_column_from_decimal (const std::string &table, const std::string &column, const int64_t cnt, const int64_t rhsDecimal, const SQLTypeInfo &rhsType, const SQLTypeInfo &lhsType, const double max_loss, const bool commit=true)
 
void anonymous_namespace{UpdelStorageTest.cpp}::import_table_file (const std::string &table, const std::string &file)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::prepare_table_for_delete (const std::string &table="trips", const std::string &column=UpdelTestConfig::sequence, const int64_t cnt=UpdelTestConfig::fixNumRows)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::check_row_count_with_string (const std::string &table, const std::string &column, const int64_t cnt, const std::string &val)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::delete_and_immediately_vacuum_rows (const std::string &table, const std::string &column, const std::string &deleted_column, const int64_t nall, const int dcnt, const int start, const int step)
 
bool anonymous_namespace{UpdelStorageTest.cpp}::delete_and_vacuum_varlen_rows (const std::string &table, const int nall, const int ndel, const int start, const int step, const bool manual_vacuum)
 
void anonymous_namespace{UpdelStorageTest.cpp}::init_table_data (const std::string &table="trips", const std::string &create_table_cmd=create_table_trips, const std::string &file=UpdelTestConfig::fixFile)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTestWithVarlenAndArrays_0, Vacuum_Half_Then_Add_All)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (ManualRowVacuumTestWithVarlenAndArrays, Vacuum_Half_First)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (ManualRowVacuumTestWithVarlenAndArrays, Vacuum_Half_Second)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (ManualRowVacuumTestWithVarlenAndArrays, Vacuum_Interleaved_2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (ManualRowVacuumTestWithVarlenAndArrays, Vacuum_Interleaved_3)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTestWithVarlenAndArrays, Vacuum_Half_First)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTestWithVarlenAndArrays, Vacuum_Half_Second)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTestWithVarlenAndArrays, Vacuum_Interleaved_2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTestWithVarlenAndArrays, Vacuum_Interleaved_3)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTest, Vacuum_Half_First)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTest, Vacuum_Half_Second)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTest, Vacuum_Interleaved_2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (RowVacuumTest, Vacuum_Interleaved_4)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_smallint_rate_code_id_null_8)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_smallint_rate_code_id_null_16)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_smallint_rate_code_id_null_32_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_smallint_rate_code_id_null_64_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_integer_passenger_count_null_16)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_integer_passenger_count_null_32)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_integer_passenger_count_null_64_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_integer_trip_time_in_secs_null_32)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_integer_trip_time_in_secs_null_64_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_smallint_rate_code_id_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_0_LHS_decimal_19_5)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_2_LHS_decimal_19_5)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_15_2_LHS_decimal_19_5)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_17_2_LHS_decimal_19_5_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_0_LHS_double)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_2_LHS_double)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_15_2_LHS_double)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_0_LHS_integer)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_10_2_LHS_integer)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_RHS_decimal_15_5_LHS_integer)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_integer_passenger_count_x1_throw)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_fixed_encoded_integer_passenger_count_x1_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_fixed_encoded_integer_passenger_count_x2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_fixed_encoded_integer_passenger_count_x2_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_int_trip_time_in_secs_x2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_int_trip_time_in_secs_x2_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_int_trip_time_in_secs_x2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_int_trip_time_in_secs_x2_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_float_trip_distance_x2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_float_trip_distance_x2_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_float_trip_distance_x2)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_float_trip_distance_x2_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_string_vendor_id)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_string_vendor_id_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_string_vendor_id)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_string_vendor_id_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_boolean_deleted)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, All_boolean_deleted_rollback)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_boolean_deleted)
 
 anonymous_namespace{UpdelStorageTest.cpp}::TEST_F (UpdateStorageTest, Half_boolean_deleted_rollback)
 
int main (int argc, char **argv)
 

Variables

static constexpr int anonymous_namespace{UpdelStorageTest.cpp}::varNumRowsByDefault = 8
 
static constexpr int anonymous_namespace{UpdelStorageTest.cpp}::fixNumRowsByDefault = 100
 
const std::string anonymous_namespace{UpdelStorageTest.cpp}::create_varlen_table1
 
const std::string anonymous_namespace{UpdelStorageTest.cpp}::create_varlen_table2
 
const std::string anonymous_namespace{UpdelStorageTest.cpp}::create_varlen_table3
 
const std::string anonymous_namespace{UpdelStorageTest.cpp}::create_table_trips
 

Macro Definition Documentation

◆ BASE_PATH

#define BASE_PATH   "./tmp"

Definition at line 40 of file UpdelStorageTest.cpp.

Referenced by main().

◆ SQLTypeInfo_dropoff_latitude

#define SQLTypeInfo_dropoff_latitude   SQLTypeInfo(kDECIMAL, 19, 5, false)

◆ SQLTypeInfo_dropoff_longitude

#define SQLTypeInfo_dropoff_longitude   SQLTypeInfo(kDOUBLE, false)

◆ SQLTypeInfo_trip_time_in_secs

#define SQLTypeInfo_trip_time_in_secs   SQLTypeInfo(kINT, false)

◆ update_a_datetime_column

#define update_a_datetime_column   update_a_encoded_string_column

Definition at line 308 of file UpdelStorageTest.cpp.

Typedef Documentation

◆ QR

Definition at line 45 of file UpdelStorageTest.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1081 of file UpdelStorageTest.cpp.

References BASE_PATH, logger::ERROR, QueryRunner::QueryRunner::init(), TestHelpers::init_logger_stderr_only(), LOG, and QueryRunner::QueryRunner::reset().

1081  {
1083  testing::InitGoogleTest(&argc, argv);
1084 
1086 
1087  // the data files for perf tests are too big to check in, so perf tests
1088  // are done privately in someone's dev host. prog option seems a overkill.
1089  auto var_file = getenv("updel_var_file"); // used to be "varlen.big"
1090  auto var_nrow = getenv("updel_var_nrow"); // used to be 1'000'000
1091  auto fix_file = getenv("updel_fix_file"); // used to be S3 file "trip_data_32m.tgz"
1092  auto fix_nrow = getenv("updel_fix_nrow"); // used to be 32'000'000
1093  if (var_file && *var_file && var_nrow && *var_nrow) {
1094  UpdelTestConfig::enableVarUpdelPerfTest = true;
1095  UpdelTestConfig::varFile = var_file;
1096  UpdelTestConfig::varNumRows = atoi(var_nrow);
1097  }
1098  if (fix_file && *fix_file && fix_nrow && *fix_nrow) {
1099  UpdelTestConfig::enableFixUpdelPerfTest = true;
1100  UpdelTestConfig::fixFile = fix_file;
1101  UpdelTestConfig::fixNumRows = atoi(fix_nrow);
1102  }
1103  UpdelTestConfig::showMeasuredTime =
1104  UpdelTestConfig::enableVarUpdelPerfTest || UpdelTestConfig::enableFixUpdelPerfTest;
1105 
1106  int err{0};
1107  try {
1108  err = RUN_ALL_TESTS();
1109  } catch (const std::exception& e) {
1110  LOG(ERROR) << e.what();
1111  }
1112  QR::reset();
1113  return err;
1114 }
#define BASE_PATH
#define LOG(tag)
Definition: Logger.h:182
static QueryRunner * init(const char *db_path, const std::string &udf_filename="", const size_t max_gpu_mem=0, const int reserved_gpu_mem=256<< 20)
Definition: QueryRunner.h:70
void init_logger_stderr_only(int argc, char const *const *argv)
Definition: TestHelpers.h:194
+ Here is the call graph for this function: