OmniSciDB  04ee39c94c
anonymous_namespace{ImportTest.cpp} Namespace Reference

Namespaces

 anonymous_namespace{ImportTest.cpp}
 

Classes

class  GeoGDALImportTest
 
class  GeoImportTest
 
class  ImportTest
 
class  ImportTestDate
 
class  ImportTestDateArray
 
class  ImportTestLegacyDate
 
class  ImportTestMiniSort
 
class  ImportTestMixedVarlen
 
class  ImportTestSharded
 
class  ImportTestShardedText
 
class  ImportTestShardedText8
 
class  ImportTestTimestamps
 

Typedefs

using QR = QueryRunner::QueryRunner
 

Functions

void run_ddl_statement (const string &input_str)
 
std::shared_ptr< ResultSetrun_query (const string &query_str)
 
bool compare_agg (const int64_t cnt, const double avg)
 
bool import_test_common (const string &query_str, const int64_t cnt, const double avg)
 
bool import_test_common_geo (const string &query_str, const std::string &table, const int64_t cnt, const double avg)
 
void import_test_geofile_importer (const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
 
bool import_test_local (const string &filename, const int64_t cnt, const double avg)
 
bool import_test_local_geo (const string &filename, const string &other_options, const int64_t cnt, const double avg)
 
std::string TypeToString (SQLTypes type)
 
void d (const SQLTypes expected_type, const std::string &str)
 
 TEST (Detect, DateTime)
 
 TEST (Detect, Numeric)
 
void create_minisort_table_on_column (const std::string &column_name)
 
void check_minisort_on_expects (const std::string &table_name, const std::vector< int > &expects)
 
void test_minisort_on_column (const std::string &column_name, const std::vector< int > expects)
 
void create_minisort_table_on_column_with_ctas (const std::string &column_name)
 
void test_minisort_on_column_with_ctas (const std::string &column_name, const std::vector< int > expects)
 
 TEST_F (ImportTestMiniSort, on_none)
 
 TEST_F (ImportTestMiniSort, on_int)
 
 TEST_F (ImportTestMiniSort, on_float)
 
 TEST_F (ImportTestMiniSort, on_int_array)
 
 TEST_F (ImportTestMiniSort, on_string_array)
 
 TEST_F (ImportTestMiniSort, on_string_2b)
 
 TEST_F (ImportTestMiniSort, on_date)
 
 TEST_F (ImportTestMiniSort, on_date_2b)
 
 TEST_F (ImportTestMiniSort, on_time)
 
 TEST_F (ImportTestMiniSort, on_time_4b)
 
 TEST_F (ImportTestMiniSort, on_varlen_array)
 
 TEST_F (ImportTestMiniSort, on_geo_point)
 
 TEST_F (ImportTestMiniSort, ctas_on_none)
 
 TEST_F (ImportTestMiniSort, ctas_on_int)
 
 TEST_F (ImportTestMiniSort, ctas_on_float)
 
 TEST_F (ImportTestMiniSort, ctas_on_int_array)
 
 TEST_F (ImportTestMiniSort, ctas_on_string_array)
 
 TEST_F (ImportTestMiniSort, ctas_on_string_2b)
 
 TEST_F (ImportTestMiniSort, ctas_on_date)
 
 TEST_F (ImportTestMiniSort, ctas_on_date_2b)
 
 TEST_F (ImportTestMiniSort, ctas_on_time)
 
 TEST_F (ImportTestMiniSort, ctas_on_time_4b)
 
 TEST_F (ImportTestMiniSort, ctas_on_varlen_array)
 
 TEST_F (ImportTestMiniSort, ctas_on_geo_point)
 
 TEST_F (ImportTestMixedVarlen, Fix_failed_import_arrays_after_geos)
 
std::string convert_date_to_string (int64_t d)
 
void run_mixed_dates_test ()
 
 TEST_F (ImportTestDate, ImportMixedDates)
 
 TEST_F (ImportTestLegacyDate, ImportMixedDates)
 
void decode_str_array (const TargetValue &r, std::vector< std::string > &arr)
 
 TEST_F (ImportTestDateArray, ImportMixedDateArrays)
 
std::string convert_timestamp_to_string (const time_t timeval, const int dimen)
 
void run_mixed_timestamps_test ()
 
 TEST_F (ImportTestTimestamps, ImportMixedTimestamps)
 
 TEST_F (ImportTest, One_csv_file)
 
 TEST_F (ImportTest, One_csv_file_no_newline)
 
 TEST_F (ImportTest, Many_csv_file)
 
 TEST_F (ImportTest, Many_csv_file_no_newline)
 
 TEST_F (ImportTest, One_gz_file)
 
 TEST_F (ImportTest, One_bz2_file)
 
 TEST_F (ImportTest, One_tar_with_many_csv_files)
 
 TEST_F (ImportTest, One_tgz_with_many_csv_files)
 
 TEST_F (ImportTest, One_rar_with_many_csv_files)
 
 TEST_F (ImportTest, One_zip_with_many_csv_files)
 
 TEST_F (ImportTest, One_7z_with_many_csv_files)
 
 TEST_F (ImportTest, One_tgz_with_many_csv_files_no_newline)
 
 TEST_F (ImportTestSharded, One_csv_file)
 
 TEST_F (ImportTestShardedText, One_csv_file)
 
 TEST_F (ImportTestShardedText8, One_csv_file)
 
 TEST_F (GeoImportTest, CSV_Import)
 
 TEST_F (GeoImportTest, CSV_Import_Empties)
 
 TEST_F (GeoImportTest, CSV_Import_Degenerate)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Type_Geometry)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Type_Geography)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Type_Other)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Encoding_NONE)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Encoding_GEOINT32)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_Encoding_Other)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_SRID_LonLat)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_SRID_Mercator)
 
 TEST_F (GeoImportTest, Geo_CSV_Local_SRID_Other)
 
 TEST_F (GeoGDALImportTest, Geojson_Point_Import)
 
 TEST_F (GeoGDALImportTest, Geojson_MultiPolygon_Import)
 
 TEST_F (GeoGDALImportTest, Geojson_MultiPolygon_Import_Empties)
 
 TEST_F (GeoGDALImportTest, Geojson_MultiPolygon_Import_Degenerate)
 
 TEST_F (GeoGDALImportTest, Shapefile_Point_Import)
 
 TEST_F (GeoGDALImportTest, Shapefile_MultiPolygon_Import)
 
 TEST_F (GeoGDALImportTest, Shapefile_Point_Import_Compressed)
 
 TEST_F (GeoGDALImportTest, Shapefile_MultiPolygon_Import_Compressed)
 
 TEST_F (GeoGDALImportTest, Shapefile_Point_Import_3857)
 
 TEST_F (GeoGDALImportTest, Shapefile_MultiPolygon_Import_3857)
 
 TEST_F (GeoGDALImportTest, Geojson_MultiPolygon_Append)
 
 TEST_F (GeoGDALImportTest, Geodatabase_Simple)
 
 TEST_F (GeoGDALImportTest, KML_Simple)
 

Variables

bool g_aggregator {false}
 
size_t g_num_leafs {1}
 
bool g_hoist_literals {true}
 
const char * create_table_mini_sort
 
const char * create_table_mixed_varlen
 
const char * create_table_date
 
const char * create_table_date_arr
 
const char * create_table_timestamps
 
const char * create_table_trips
 
const char * create_table_trips_sharded
 
const char * create_table_trips_dict_sharded_text
 
const char * create_table_trips_dict_sharded_text_8bit
 

Typedef Documentation

◆ QR

using anonymous_namespace{ImportTest.cpp}::QR = typedef QueryRunner::QueryRunner

Definition at line 60 of file ImportTest.cpp.

Function Documentation

◆ check_minisort_on_expects()

void anonymous_namespace{ImportTest.cpp}::check_minisort_on_expects ( const std::string &  table_name,
const std::vector< int > &  expects 
)

Definition at line 340 of file ImportTest.cpp.

References CHECK_EQ, and run_query().

Referenced by test_minisort_on_column(), and test_minisort_on_column_with_ctas().

341  {
342  auto rows = run_query("SELECT i FROM " + table_name + ";");
343  CHECK_EQ(expects.size(), rows->rowCount());
344  for (auto exp : expects) {
345  auto crt_row = rows->getNextRow(true, true);
346  CHECK_EQ(size_t(1), crt_row.size());
347  CHECK_EQ(int64_t(exp), v<int64_t>(crt_row[0]));
348  }
349 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compare_agg()

bool anonymous_namespace{ImportTest.cpp}::compare_agg ( const int64_t  cnt,
const double  avg 
)

Definition at line 70 of file ImportTest.cpp.

References CHECK_EQ, logger::ERROR, LOG, and run_query().

Referenced by import_test_common().

70  {
71  std::string query_str = "SELECT COUNT(*), AVG(trip_distance) FROM trips;";
72  auto rows = run_query(query_str);
73  auto crt_row = rows->getNextRow(true, true);
74  CHECK_EQ(size_t(2), crt_row.size());
75  auto r_cnt = v<int64_t>(crt_row[0]);
76  auto r_avg = v<double>(crt_row[1]);
77  if (!(r_cnt == cnt && fabs(r_avg - avg) < 1E-9)) {
78  LOG(ERROR) << "error: " << r_cnt << ":" << cnt << ", " << r_avg << ":" << avg;
79  }
80  return r_cnt == cnt && fabs(r_avg - avg) < 1E-9;
81 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
#define LOG(tag)
Definition: Logger.h:182
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convert_date_to_string()

std::string anonymous_namespace{ImportTest.cpp}::convert_date_to_string ( int64_t  d)

Definition at line 536 of file ImportTest.cpp.

References d().

Referenced by run_mixed_dates_test(), and TEST_F().

536  {
537  if (d == std::numeric_limits<int64_t>::min()) {
538  return std::string("NULL");
539  }
540  const auto date = static_cast<time_t>(d);
541  std::tm tm_struct;
542  gmtime_r(&date, &tm_struct);
543  char buf[11];
544  strftime(buf, 11, "%F", &tm_struct);
545  return std::string(buf);
546 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convert_timestamp_to_string()

std::string anonymous_namespace{ImportTest.cpp}::convert_timestamp_to_string ( const time_t  timeval,
const int  dimen 
)

Definition at line 743 of file ImportTest.cpp.

References to_string().

Referenced by run_mixed_timestamps_test().

743  {
744  std::tm tm_struct;
745  if (dimen > 0) {
746  auto scale = static_cast<int64_t>(std::pow(10, dimen));
747  auto dv = std::div(static_cast<int64_t>(timeval), scale);
748  auto modulus = (dv.rem + scale) % scale;
749  time_t sec = dv.quot - (dv.quot < 0 && modulus > 0);
750  gmtime_r(&sec, &tm_struct);
751  char buf[21];
752  strftime(buf, 21, "%F %T.", &tm_struct);
753  auto subsecond = std::to_string(modulus);
754  return std::string(buf) + std::string(dimen - subsecond.length(), '0') + subsecond;
755  } else {
756  time_t sec = timeval;
757  gmtime_r(&sec, &tm_struct);
758  char buf[20];
759  strftime(buf, 20, "%F %T", &tm_struct);
760  return std::string(buf);
761  }
762 }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_minisort_table_on_column()

void anonymous_namespace{ImportTest.cpp}::create_minisort_table_on_column ( const std::string &  column_name)

Definition at line 331 of file ImportTest.cpp.

References run_ddl_statement().

Referenced by test_minisort_on_column(), and test_minisort_on_column_with_ctas().

331  {
332  ASSERT_NO_THROW(run_ddl_statement(
333  std::string(create_table_mini_sort) +
334  (column_name.size() ? " with (sort_column='" + column_name + "');" : ";")));
335  EXPECT_NO_THROW(
336  run_ddl_statement("copy sortab from '../../Tests/Import/datafiles/mini_sort.txt' "
337  "with (header='false');"));
338 }
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_minisort_table_on_column_with_ctas()

void anonymous_namespace{ImportTest.cpp}::create_minisort_table_on_column_with_ctas ( const std::string &  column_name)

Definition at line 357 of file ImportTest.cpp.

References run_ddl_statement().

Referenced by test_minisort_on_column_with_ctas().

357  {
358  EXPECT_NO_THROW(
360  "create table sortctas as select * from sortab" +
361  (column_name.size() ? " with (sort_column='" + column_name + "');" : ";")););
362 }
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ d()

void anonymous_namespace{ImportTest.cpp}::d ( const SQLTypes  expected_type,
const std::string &  str 
)

Definition at line 268 of file ImportTest.cpp.

References Importer_NS::Detector::detect_sqltype(), and TypeToString().

Referenced by Importer_NS::TypedImportBuffer::add_value(), Parser::FixedPtLiteral::analyze(), Parser::FloatLiteral::analyze(), Parser::DoubleLiteral::analyze(), Parser::InsertValuesStmt::analyze(), Parser::StringLiteral::analyzeValue(), Parser::IntLiteral::analyzeValue(), Parser::FixedPtLiteral::analyzeValue(), CodeGenerator::codegenCmpDecimalConst(), CodeGenerator::codegenRowId(), convert_date_to_string(), anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv(), Analyzer::Constant::deep_copy(), anonymous_namespace{UpdelStorageTest.cpp}::delete_and_immediately_vacuum_rows(), anonymous_namespace{UpdelStorageTest.cpp}::delete_and_vacuum_varlen_rows(), Catalog_Namespace::SysCatalog::deleteObjectDescriptorMap(), Parser::InsertValuesStmt::determineLeafIndex(), ExtractExpr::generate(), DateTruncExpr::generate(), anonymous_namespace{ProfileTest.cpp}::generate_numbers(), Parser::TimestampLiteral::get(), MapDHandler::get_dashboards(), anonymous_namespace{RelAlgTranslator.cpp}::get_in_values_expr(), Catalog_Namespace::SysCatalog::getDatabaseListForUser(), com.omnisci.jdbc.OmniSciResultSet::getDate(), Catalog_Namespace::SysCatalog::getMetadataForObject(), DateTimeTranslator::getNumericConstant(), CgenState::getOrAddLiteral(), Importer_NS::Importer::importDelimited(), anonymous_namespace{Execute.cpp}::insert_one_dict_str(), CudaMgr_Namespace::CudaMgr::isArchVoltaForAll(), main(), anonymous_namespace{ResultSetIteration.cpp}::make_avg_target_value(), make_fp_constant(), Parser::CaseExpr::normalize(), Importer_NS::NullArray(), Importer_NS::NullArrayDatum(), Importer_NS::NullDatum(), populate_TColumn(), Catalog_Namespace::SysCatalog::renameObjectsInDescriptorMap(), Catalog_Namespace::SysCatalog::revokeAllOnDatabase_unsafe(), Analyzer::Constant::set_constval(), SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities >::set_dimension(), SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities >::set_input_srid(), Analyzer::Query::set_is_distinct(), Planner::RootPlan::set_plan_dest(), SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities >::set_precision(), com.mapd.utility.SQLImporter::setColValue(), CudaMgr_Namespace::CudaMgr::setContext(), Importer_NS::StringToArray(), StringToDatum(), CudaMgr_Namespace::CudaMgr::synchronizeDevices(), Importer_NS::TDatumToDatum(), TEST(), TEST(), RelAlgTranslator::translateFunction(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateInOper(), RelAlgTranslator::translateLiteral(), RelAlgTranslator::translateScalarSubquery(), anonymous_namespace{CalciteAdapter.cpp}::CalciteAdapter::translateTypedLiteral(), Catalog_Namespace::SysCatalog::updateObjectDescriptorMap(), anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper(), and CudaMgr_Namespace::CudaMgr::~CudaMgr().

268  {
269  auto detected_type = Importer_NS::Detector::detect_sqltype(str);
270  EXPECT_EQ(TypeToString(expected_type), TypeToString(detected_type))
271  << "String: " << str;
272 }
static SQLTypes detect_sqltype(const std::string &str)
Definition: Importer.cpp:2768
std::string TypeToString(SQLTypes type)
Definition: ImportTest.cpp:264
+ Here is the call graph for this function:

◆ decode_str_array()

void anonymous_namespace{ImportTest.cpp}::decode_str_array ( const TargetValue r,
std::vector< std::string > &  arr 
)

Definition at line 624 of file ImportTest.cpp.

References CHECK, and CHECK_EQ.

Referenced by TEST_F().

624  {
625  const auto atv = boost::get<ArrayTargetValue>(&r);
626  CHECK(atv);
627  if (!atv->is_initialized()) {
628  return;
629  }
630  const auto& vec = atv->get();
631  for (const auto& stv : vec) {
632  const auto ns = v<NullableString>(stv);
633  const auto str = boost::get<std::string>(&ns);
634  CHECK(str);
635  arr.push_back(*str);
636  }
637  CHECK_EQ(arr.size(), vec.size());
638 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ import_test_common()

bool anonymous_namespace{ImportTest.cpp}::import_test_common ( const string &  query_str,
const int64_t  cnt,
const double  avg 
)

Definition at line 94 of file ImportTest.cpp.

References compare_agg(), and run_ddl_statement().

Referenced by import_test_local(), import_test_local_geo(), and TEST_F().

94  {
95  run_ddl_statement(query_str);
96  return compare_agg(cnt, avg);
97 }
bool compare_agg(const int64_t cnt, const double avg)
Definition: ImportTest.cpp:70
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_test_common_geo()

bool anonymous_namespace{ImportTest.cpp}::import_test_common_geo ( const string &  query_str,
const std::string &  table,
const int64_t  cnt,
const double  avg 
)

Definition at line 99 of file ImportTest.cpp.

References CHECK_EQ, Parser::CopyTableStmt::execute(), QueryRunner::QueryRunner::get(), Parser::CopyTableStmt::get_geo_copy_from_payload(), run-benchmark-import::parser, and Parser::CopyTableStmt::was_geo_copy_from().

Referenced by import_test_local_geo(), and TEST_F().

102  {
103  // TODO(adb): Return ddl from QueryRunner::run_ddl_statement and use that
104  SQLParser parser;
105  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
106  std::string last_parsed;
107  if (parser.parse(query_str, parse_trees, last_parsed)) {
108  return false;
109  }
110  CHECK_EQ(parse_trees.size(), size_t(1));
111  const auto& stmt = parse_trees.front();
112  Parser::CopyTableStmt* ddl = dynamic_cast<Parser::CopyTableStmt*>(stmt.get());
113  if (!ddl) {
114  return false;
115  }
116  ddl->execute(*QR::get()->getSession());
117 
118  // was it a geo copy from?
119  bool was_geo_copy_from = ddl->was_geo_copy_from();
120  if (!was_geo_copy_from) {
121  return false;
122  }
123 
124  // get the rest of the payload
125  std::string geo_copy_from_table, geo_copy_from_file_name, geo_copy_from_partitions;
126  Importer_NS::CopyParams geo_copy_from_copy_params;
127  ddl->get_geo_copy_from_payload(geo_copy_from_table,
128  geo_copy_from_file_name,
129  geo_copy_from_copy_params,
130  geo_copy_from_partitions);
131 
132  // was it the right table?
133  if (geo_copy_from_table != "geo") {
134  return false;
135  }
136 
137  // @TODO simon.eves
138  // test other stuff
139  // filename
140  // CopyParams contents
141 
142  // success
143  return true;
144 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
void get_geo_copy_from_payload(std::string &geo_copy_from_table, std::string &geo_copy_from_file_name, Importer_NS::CopyParams &geo_copy_from_copy_params, std::string &geo_copy_from_partitions)
Definition: ParserNode.h:1297
void execute(const Catalog_Namespace::SessionInfo &session) override
static QueryRunner * get()
Definition: QueryRunner.h:115
bool was_geo_copy_from() const
Definition: ParserNode.h:1295
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_test_geofile_importer()

void anonymous_namespace{ImportTest.cpp}::import_test_geofile_importer ( const std::string &  file_str,
const std::string &  table_name,
const bool  compression,
const bool  create_table = true 
)

Definition at line 146 of file ImportTest.cpp.

References CPU, QueryRunner::QueryRunner::get(), QueryRunner::get_user_metadata(), and Importer_NS::ImportDriver::importGeoTable().

Referenced by TEST_F().

149  {
150  Importer_NS::ImportDriver import_driver(
151  QR::get()->getCatalog(),
152  QueryRunner::get_user_metadata(QR::get()->getSession()),
154 
155  auto file_path = boost::filesystem::path("../../Tests/Import/datafiles/" + file_str);
156 
157  ASSERT_TRUE(boost::filesystem::exists(file_path));
158 
159  ASSERT_NO_THROW(import_driver.importGeoTable(
160  file_path.string(), table_name, compression, create_table));
161 }
static QueryRunner * get()
Definition: QueryRunner.h:115
Catalog_Namespace::UserMetadata get_user_metadata(const Catalog_Namespace::SessionInfo *session)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_test_local()

bool anonymous_namespace{ImportTest.cpp}::import_test_local ( const string &  filename,
const int64_t  cnt,
const double  avg 
)

Definition at line 163 of file ImportTest.cpp.

References import_test_common().

Referenced by import_test_local_geo(), and TEST_F().

163  {
164  return import_test_common(
165  string("COPY trips FROM '") + "../../Tests/Import/datafiles/" + filename +
166  "' WITH (header='true'" +
167  (filename.find(".parquet") != std::string::npos ? ",parquet='true'" : "") +
168  ");",
169  cnt,
170  avg);
171 }
bool import_test_common(const string &query_str, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:94
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_test_local_geo()

bool anonymous_namespace{ImportTest.cpp}::import_test_local_geo ( const string &  filename,
const string &  other_options,
const int64_t  cnt,
const double  avg 
)

Definition at line 173 of file ImportTest.cpp.

References CHECK_EQ, import_test_common(), import_test_common_geo(), import_test_local(), run_ddl_statement(), and run_query().

Referenced by TEST_F().

176  {
177  return import_test_common_geo(string("COPY geo FROM '") +
178  "../../Tests/Import/datafiles/" + filename +
179  "' WITH (geo='true'" + other_options + ");",
180  "geo",
181  cnt,
182  avg);
183 }
bool import_test_common_geo(const string &query_str, const std::string &table, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_ddl_statement()

void anonymous_namespace{ImportTest.cpp}::run_ddl_statement ( const string &  input_str)
inline

Definition at line 62 of file ImportTest.cpp.

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

62  {
63  QR::get()->runDDLStatement(input_str);
64 }
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:

◆ run_mixed_dates_test()

void anonymous_namespace{ImportTest.cpp}::run_mixed_dates_test ( )
inline

Definition at line 548 of file ImportTest.cpp.

References CHECK, convert_date_to_string(), run_ddl_statement(), and run_query().

Referenced by TEST_F().

548  {
549  ASSERT_NO_THROW(run_ddl_statement(
550  "COPY import_test_date FROM '../../Tests/Import/datafiles/mixed_dates.txt';"));
551 
552  auto rows = run_query("SELECT * FROM import_test_date;");
553  ASSERT_EQ(size_t(11), rows->entryCount());
554  for (size_t i = 0; i < 10; i++) {
555  const auto crt_row = rows->getNextRow(true, true);
556  ASSERT_EQ(size_t(5), crt_row.size());
557  const auto date_truth_str_nullable = v<NullableString>(crt_row[0]);
558  const auto date_truth_str = boost::get<std::string>(&date_truth_str_nullable);
559  CHECK(date_truth_str);
560  for (size_t j = 1; j < crt_row.size(); j++) {
561  const auto date = v<int64_t>(crt_row[j]);
562  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
563  ASSERT_EQ(*date_truth_str, date_str);
564  }
565  }
566 
567  // Last row is NULL (except for column 2 which is NOT NULL)
568  const auto crt_row = rows->getNextRow(true, true);
569  ASSERT_EQ(size_t(5), crt_row.size());
570  for (size_t j = 1; j < crt_row.size(); j++) {
571  if (j == 2) {
572  continue;
573  }
574  const auto date_null = v<int64_t>(crt_row[j]);
575  ASSERT_EQ(date_null, std::numeric_limits<int64_t>::min());
576  }
577 }
std::string convert_date_to_string(int64_t d)
Definition: ImportTest.cpp:536
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
#define CHECK(condition)
Definition: Logger.h:187
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_mixed_timestamps_test()

void anonymous_namespace{ImportTest.cpp}::run_mixed_timestamps_test ( )
inline

Definition at line 764 of file ImportTest.cpp.

References CHECK, convert_timestamp_to_string(), run_ddl_statement(), and run_query().

Referenced by TEST_F().

764  {
765  EXPECT_NO_THROW(
766  run_ddl_statement("COPY import_test_timestamps FROM "
767  "'../../Tests/Import/datafiles/mixed_timestamps.txt';"));
768 
769  auto rows = run_query("SELECT * FROM import_test_timestamps");
770  ASSERT_EQ(size_t(11), rows->entryCount());
771  for (size_t i = 0; i < rows->entryCount() - 1; i++) {
772  const auto crt_row = rows->getNextRow(true, true);
773  ASSERT_EQ(size_t(13), crt_row.size());
774  const auto ts0_str_nullable = v<NullableString>(crt_row[0]);
775  const auto ts0_str = boost::get<std::string>(&ts0_str_nullable);
776  const auto ts3_str_nullable = v<NullableString>(crt_row[1]);
777  const auto ts3_str = boost::get<std::string>(&ts3_str_nullable);
778  const auto ts6_str_nullable = v<NullableString>(crt_row[2]);
779  const auto ts6_str = boost::get<std::string>(&ts6_str_nullable);
780  const auto ts9_str_nullable = v<NullableString>(crt_row[3]);
781  const auto ts9_str = boost::get<std::string>(&ts9_str_nullable);
782  CHECK(ts0_str && ts3_str && ts6_str && ts9_str);
783  for (size_t j = 4; j < crt_row.size(); j++) {
784  const auto timeval = v<int64_t>(crt_row[j]);
785  const auto ti = rows->getColType(j);
786  CHECK(ti.is_timestamp());
787  const auto ts_str = convert_timestamp_to_string(timeval, ti.get_dimension());
788  switch (ti.get_dimension()) {
789  case 0:
790  ASSERT_EQ(*ts0_str, ts_str);
791  break;
792  case 3:
793  ASSERT_EQ(*ts3_str, ts_str);
794  break;
795  case 6:
796  ASSERT_EQ(*ts6_str, ts_str);
797  break;
798  case 9:
799  ASSERT_EQ(*ts9_str, ts_str);
800  break;
801  default:
802  CHECK(false);
803  }
804  }
805  }
806 
807  const auto crt_row = rows->getNextRow(true, true);
808  ASSERT_EQ(size_t(13), crt_row.size());
809  for (size_t j = 4; j < crt_row.size(); j++) {
810  if (j == 6 || j == 8 || j == 10 || j == 12) {
811  continue;
812  }
813  const auto ts_null = v<int64_t>(crt_row[j]);
814  ASSERT_EQ(ts_null, std::numeric_limits<int64_t>::min());
815  }
816 }
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
#define CHECK(condition)
Definition: Logger.h:187
void run_ddl_statement(std::string ddl)
std::string convert_timestamp_to_string(const time_t timeval, const int dimen)
Definition: ImportTest.cpp:743
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_query()

std::shared_ptr<ResultSet> anonymous_namespace{ImportTest.cpp}::run_query ( const string &  query_str)

Definition at line 66 of file ImportTest.cpp.

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

Referenced by anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_tv_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_tv_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), check_minisort_on_expects(), compare_agg(), import_test_local_geo(), run_mixed_dates_test(), run_mixed_timestamps_test(), and TEST_F().

66  {
68 }
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:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TEST() [1/2]

anonymous_namespace{ImportTest.cpp}::TEST ( Detect  ,
DateTime   
)

Definition at line 274 of file ImportTest.cpp.

References d(), kDATE, kTEXT, kTIME, and kTIMESTAMP.

274  {
275  d(kDATE, "2016-01-02");
276  d(kDATE, "02/01/2016");
277  d(kDATE, "01-Feb-16");
278  d(kDATE, "01/Feb/2016");
279  d(kDATE, "01/Feb/16");
280  d(kTIMESTAMP, "2016-01-02T03:04");
281  d(kTIMESTAMP, "2016-01-02T030405");
282  d(kTIMESTAMP, "2016-01-02T03:04:05");
283  d(kTIMESTAMP, "1776-01-02T03:04:05");
284  d(kTIMESTAMP, "9999-01-02T03:04:05");
285  d(kTIME, "03:04");
286  d(kTIME, "03:04:05");
287  d(kTEXT, "33:04");
288 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
Definition: sqltypes.h:51
Definition: sqltypes.h:54
Definition: sqltypes.h:55
+ Here is the call graph for this function:

◆ TEST() [2/2]

anonymous_namespace{ImportTest.cpp}::TEST ( Detect  ,
Numeric   
)

Definition at line 290 of file ImportTest.cpp.

References d(), kBIGINT, kFLOAT, kINT, kSMALLINT, and kTEXT.

290  {
291  d(kSMALLINT, "1");
292  d(kSMALLINT, "12345");
293  d(kINT, "123456");
294  d(kINT, "1234567890");
295  d(kBIGINT, "12345678901");
296  d(kFLOAT, "1.");
297  d(kFLOAT, "1.2345678");
298  // d(kDOUBLE, "1.2345678901");
299  // d(kDOUBLE, "1.23456789012345678901234567890");
300  d(kTEXT, "1.22.22");
301 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
Definition: sqltypes.h:54
Definition: sqltypes.h:47
+ Here is the call graph for this function:

◆ TEST_F() [1/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_none   
)

Definition at line 371 of file ImportTest.cpp.

References test_minisort_on_column().

371  {
372  test_minisort_on_column("", {5, 3, 1, 2, 4});
373 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [2/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_int   
)

Definition at line 375 of file ImportTest.cpp.

References test_minisort_on_column().

375  {
376  test_minisort_on_column("i", {1, 2, 3, 4, 5});
377 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [3/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_float   
)

Definition at line 379 of file ImportTest.cpp.

References test_minisort_on_column().

379  {
380  test_minisort_on_column("f", {1, 2, 3, 4, 5});
381 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [4/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_int_array   
)

Definition at line 383 of file ImportTest.cpp.

References test_minisort_on_column().

383  {
384  test_minisort_on_column("ia", {1, 2, 3, 4, 5});
385 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [5/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_string_array   
)

Definition at line 387 of file ImportTest.cpp.

References test_minisort_on_column().

387  {
388  test_minisort_on_column("sa", {5, 3, 1, 2, 4});
389 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [6/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_string_2b   
)

Definition at line 391 of file ImportTest.cpp.

References test_minisort_on_column().

391  {
392  test_minisort_on_column("s2", {5, 3, 1, 2, 4});
393 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [7/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_date   
)

Definition at line 395 of file ImportTest.cpp.

References test_minisort_on_column().

395  {
396  test_minisort_on_column("dt", {1, 2, 3, 4, 5});
397 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [8/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_date_2b   
)

Definition at line 399 of file ImportTest.cpp.

References test_minisort_on_column().

399  {
400  test_minisort_on_column("d2", {1, 2, 3, 4, 5});
401 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [9/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_time   
)

Definition at line 403 of file ImportTest.cpp.

References test_minisort_on_column().

403  {
404  test_minisort_on_column("tm", {1, 2, 3, 4, 5});
405 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [10/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_time_4b   
)

Definition at line 407 of file ImportTest.cpp.

References test_minisort_on_column().

407  {
408  test_minisort_on_column("t4", {1, 2, 3, 4, 5});
409 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [11/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_varlen_array   
)

Definition at line 411 of file ImportTest.cpp.

References test_minisort_on_column().

411  {
412  test_minisort_on_column("va", {1, 2, 3, 4, 5});
413 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [12/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
on_geo_point   
)

Definition at line 415 of file ImportTest.cpp.

References test_minisort_on_column().

415  {
416  test_minisort_on_column("pt", {2, 3, 4, 5, 1});
417 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:351
+ Here is the call graph for this function:

◆ TEST_F() [13/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_none   
)

Definition at line 419 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

419  {
421  test_minisort_on_column_with_ctas("", {5, 3, 1, 2, 4});
422 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [14/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_int   
)

Definition at line 424 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

424  {
426  test_minisort_on_column_with_ctas("i", {1, 2, 3, 4, 5});
427 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [15/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_float   
)

Definition at line 429 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

429  {
431  test_minisort_on_column_with_ctas("f", {1, 2, 3, 4, 5});
432 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [16/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_int_array   
)

Definition at line 434 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

434  {
436  test_minisort_on_column_with_ctas("ia", {1, 2, 3, 4, 5});
437 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [17/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_string_array   
)

Definition at line 439 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

439  {
441  test_minisort_on_column_with_ctas("sa", {5, 3, 1, 2, 4});
442 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [18/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_string_2b   
)

Definition at line 444 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

444  {
446  test_minisort_on_column_with_ctas("s2", {5, 3, 1, 2, 4});
447 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [19/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_date   
)

Definition at line 449 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

449  {
451  test_minisort_on_column_with_ctas("dt", {1, 2, 3, 4, 5});
452 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [20/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_date_2b   
)

Definition at line 454 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

454  {
456  test_minisort_on_column_with_ctas("d2", {1, 2, 3, 4, 5});
457 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [21/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_time   
)

Definition at line 459 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

459  {
461  test_minisort_on_column_with_ctas("tm", {1, 2, 3, 4, 5});
462 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [22/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_time_4b   
)

Definition at line 464 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

464  {
466  test_minisort_on_column_with_ctas("t4", {1, 2, 3, 4, 5});
467 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [23/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_varlen_array   
)

Definition at line 469 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

469  {
471  test_minisort_on_column_with_ctas("va", {1, 2, 3, 4, 5});
472 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [24/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMiniSort  ,
ctas_on_geo_point   
)

Definition at line 474 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

474  {
476  test_minisort_on_column_with_ctas("pt", {2, 3, 4, 5, 1});
477 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
void test_minisort_on_column_with_ctas(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:364
+ Here is the call graph for this function:

◆ TEST_F() [25/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestMixedVarlen  ,
Fix_failed_import_arrays_after_geos   
)

Definition at line 502 of file ImportTest.cpp.

References CHECK_EQ, run_ddl_statement(), and run_query().

502  {
503  EXPECT_NO_THROW(
504  run_ddl_statement("copy import_test_mixed_varlen from "
505  "'../../Tests/Import/datafiles/mixed_varlen.txt' with "
506  "(header='false');"));
507  std::string query_str = "SELECT COUNT(*) FROM import_test_mixed_varlen;";
508  auto rows = run_query(query_str);
509  auto crt_row = rows->getNextRow(true, true);
510  CHECK_EQ(size_t(1), crt_row.size());
511  CHECK_EQ(int64_t(1), v<int64_t>(crt_row[0]));
512 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:

◆ TEST_F() [26/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestDate  ,
ImportMixedDates   
)

Definition at line 579 of file ImportTest.cpp.

References run_mixed_dates_test(), and SKIP_ALL_ON_AGGREGATOR.

579  {
580  SKIP_ALL_ON_AGGREGATOR(); // global variable not available on leaf nodes
582 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [27/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestLegacyDate  ,
ImportMixedDates   
)

Definition at line 598 of file ImportTest.cpp.

References run_mixed_dates_test(), and SKIP_ALL_ON_AGGREGATOR.

598  {
599  SKIP_ALL_ON_AGGREGATOR(); // global variable not available on leaf nodes
601 }
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [28/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestDateArray  ,
ImportMixedDateArrays   
)

Definition at line 640 of file ImportTest.cpp.

References CHECK, convert_date_to_string(), decode_str_array(), run_ddl_statement(), and run_query().

640  {
641  EXPECT_NO_THROW(
642  run_ddl_statement("COPY import_test_date_arr FROM "
643  "'../../Tests/Import/datafiles/mixed_date_arrays.txt';"));
644 
645  auto rows = run_query("SELECT * FROM import_test_date_arr;");
646  ASSERT_EQ(size_t(10), rows->entryCount());
647  for (size_t i = 0; i < 3; i++) {
648  const auto crt_row = rows->getNextRow(true, true);
649  ASSERT_EQ(size_t(4), crt_row.size());
650  std::vector<std::string> truth_arr;
651  decode_str_array(crt_row[0], truth_arr);
652  for (size_t j = 1; j < crt_row.size(); j++) {
653  const auto date_arr = boost::get<ArrayTargetValue>(&crt_row[j]);
654  CHECK(date_arr && date_arr->is_initialized());
655  const auto& vec = date_arr->get();
656  for (size_t k = 0; k < vec.size(); k++) {
657  const auto date = v<int64_t>(vec[k]);
658  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
659  ASSERT_EQ(truth_arr[k], date_str);
660  }
661  }
662  }
663  // Date arrays with NULL dates
664  for (size_t i = 3; i < 6; i++) {
665  const auto crt_row = rows->getNextRow(true, true);
666  ASSERT_EQ(size_t(4), crt_row.size());
667  std::vector<std::string> truth_arr;
668  decode_str_array(crt_row[0], truth_arr);
669  for (size_t j = 1; j < crt_row.size() - 1; j++) {
670  const auto date_arr = boost::get<ArrayTargetValue>(&crt_row[j]);
671  CHECK(date_arr && date_arr->is_initialized());
672  const auto& vec = date_arr->get();
673  for (size_t k = 0; k < vec.size(); k++) {
674  const auto date = v<int64_t>(vec[k]);
675  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
676  ASSERT_EQ(truth_arr[k], date_str);
677  }
678  }
679  }
680  // NULL date arrays, empty date arrays, NULL fixed date arrays
681  for (size_t i = 6; i < rows->entryCount(); i++) {
682  const auto crt_row = rows->getNextRow(true, true);
683  ASSERT_EQ(size_t(4), crt_row.size());
684  const auto date_arr1 = boost::get<ArrayTargetValue>(&crt_row[1]);
685  CHECK(date_arr1);
686  if (i == 9) {
687  // Empty date array
688  CHECK(date_arr1->is_initialized());
689  const auto& vec = date_arr1->get();
690  ASSERT_EQ(size_t(0), vec.size());
691  } else {
692  // NULL array
693  CHECK(!date_arr1->is_initialized());
694  }
695  const auto date_arr2 = boost::get<ArrayTargetValue>(&crt_row[2]);
696  CHECK(date_arr2);
697  if (i == 9) {
698  // Fixlen array - not NULL, filled with NULLs
699  CHECK(date_arr2->is_initialized());
700  const auto& vec = date_arr2->get();
701  for (size_t k = 0; k < vec.size(); k++) {
702  const auto date = v<int64_t>(vec[k]);
703  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
704  ASSERT_EQ("NULL", date_str);
705  }
706  } else {
707  // NULL fixlen array
708  CHECK(!date_arr2->is_initialized());
709  }
710  }
711 }
std::string convert_date_to_string(int64_t d)
Definition: ImportTest.cpp:536
std::shared_ptr< ResultSet > run_query(const string &query_str)
Definition: ImportTest.cpp:66
void decode_str_array(const TargetValue &r, std::vector< std::string > &arr)
Definition: ImportTest.cpp:624
#define CHECK(condition)
Definition: Logger.h:187
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:

◆ TEST_F() [29/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestTimestamps  ,
ImportMixedTimestamps   
)

Definition at line 818 of file ImportTest.cpp.

References run_mixed_timestamps_test().

818  {
820 }
+ Here is the call graph for this function:

◆ TEST_F() [30/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_csv_file   
)

Definition at line 922 of file ImportTest.cpp.

References import_test_local().

922  {
923  EXPECT_TRUE(import_test_local("trip_data_9.csv", 100, 1.0));
924 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [31/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_csv_file_no_newline   
)

Definition at line 926 of file ImportTest.cpp.

References import_test_local().

926  {
927  EXPECT_TRUE(import_test_local("trip_data_no_newline_1.csv", 100, 1.0));
928 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [32/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
Many_csv_file   
)

Definition at line 930 of file ImportTest.cpp.

References import_test_local().

930  {
931  EXPECT_TRUE(import_test_local("trip_data_*.csv", 1200, 1.0));
932 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [33/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
Many_csv_file_no_newline   
)

Definition at line 934 of file ImportTest.cpp.

References import_test_local().

934  {
935  EXPECT_TRUE(import_test_local("trip_data_no_newline_*.csv", 200, 1.0));
936 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [34/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_gz_file   
)

Definition at line 938 of file ImportTest.cpp.

References import_test_local().

938  {
939  EXPECT_TRUE(import_test_local("trip_data_9.gz", 100, 1.0));
940 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [35/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_bz2_file   
)

Definition at line 942 of file ImportTest.cpp.

References import_test_local().

942  {
943  EXPECT_TRUE(import_test_local("trip_data_9.bz2", 100, 1.0));
944 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [36/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_tar_with_many_csv_files   
)

Definition at line 946 of file ImportTest.cpp.

References import_test_local().

946  {
947  EXPECT_TRUE(import_test_local("trip_data.tar", 1000, 1.0));
948 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [37/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_tgz_with_many_csv_files   
)

Definition at line 950 of file ImportTest.cpp.

References import_test_local().

950  {
951  EXPECT_TRUE(import_test_local("trip_data.tgz", 100000, 1.0));
952 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [38/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_rar_with_many_csv_files   
)

Definition at line 954 of file ImportTest.cpp.

References import_test_local().

954  {
955  EXPECT_TRUE(import_test_local("trip_data.rar", 1000, 1.0));
956 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [39/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_zip_with_many_csv_files   
)

Definition at line 958 of file ImportTest.cpp.

References import_test_local().

958  {
959  EXPECT_TRUE(import_test_local("trip_data.zip", 1000, 1.0));
960 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [40/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_7z_with_many_csv_files   
)

Definition at line 962 of file ImportTest.cpp.

References import_test_local().

962  {
963  EXPECT_TRUE(import_test_local("trip_data.7z", 1000, 1.0));
964 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [41/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTest  ,
One_tgz_with_many_csv_files_no_newline   
)

Definition at line 966 of file ImportTest.cpp.

References import_test_local().

966  {
967  EXPECT_TRUE(import_test_local("trip_data_some_with_no_newline.tgz", 500, 1.0));
968 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [42/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestSharded  ,
One_csv_file   
)

Definition at line 1006 of file ImportTest.cpp.

References import_test_local().

1006  {
1007  EXPECT_TRUE(import_test_local("sharded_trip_data_9.csv", 100, 1.0));
1008 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [43/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestShardedText  ,
One_csv_file   
)

Definition at line 1045 of file ImportTest.cpp.

References import_test_local().

1045  {
1046  EXPECT_TRUE(import_test_local("sharded_trip_data_9.csv", 100, 1.0));
1047 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [44/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestShardedText8  ,
One_csv_file   
)

Definition at line 1084 of file ImportTest.cpp.

References import_test_local().

1084  {
1085  EXPECT_TRUE(import_test_local("sharded_trip_data_9.csv", 100, 1.0));
1086 }
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
+ Here is the call graph for this function:

◆ TEST_F() [45/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
CSV_Import   
)

Definition at line 1193 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), and run_ddl_statement().

1193  {
1194  const auto file_path =
1195  boost::filesystem::path("../../Tests/Import/datafiles/geospatial.csv");
1196  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1197  check_geo_import();
1198  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance", 10);
1199 }
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:

◆ TEST_F() [46/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
CSV_Import_Empties   
)

Definition at line 1201 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), and run_ddl_statement().

1201  {
1202  const auto file_path =
1203  boost::filesystem::path("../../Tests/Import/datafiles/geospatial_empties.csv");
1204  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1205  check_geo_import();
1206  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance",
1207  6); // we expect it to drop the 4 rows containing 'EMPTY'
1208 }
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:

◆ TEST_F() [47/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
CSV_Import_Degenerate   
)

Definition at line 1210 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), and run_ddl_statement().

1210  {
1211  const auto file_path =
1212  boost::filesystem::path("../../Tests/Import/datafiles/geospatial_degenerate.csv");
1213  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1214  check_geo_import();
1215  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance",
1216  6); // we expect it to drop the 4 rows containing degenerate polys
1217 }
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
void run_ddl_statement(std::string ddl)
+ Here is the call graph for this function:

◆ TEST_F() [48/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Type_Geometry   
)

Definition at line 1221 of file ImportTest.cpp.

References import_test_local_geo().

1221  {
1222  EXPECT_TRUE(
1223  import_test_local_geo("geospatial.csv", ", geo_coords_type='geometry'", 10, 4.5));
1224 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [49/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Type_Geography   
)

Definition at line 1226 of file ImportTest.cpp.

References import_test_local_geo().

1226  {
1227  EXPECT_THROW(
1228  import_test_local_geo("geospatial.csv", ", geo_coords_type='geography'", 10, 4.5),
1229  std::runtime_error);
1230 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [50/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Type_Other   
)

Definition at line 1232 of file ImportTest.cpp.

References import_test_local_geo().

1232  {
1233  EXPECT_THROW(
1234  import_test_local_geo("geospatial.csv", ", geo_coords_type='other'", 10, 4.5),
1235  std::runtime_error);
1236 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [51/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Encoding_NONE   
)

Definition at line 1238 of file ImportTest.cpp.

References import_test_local_geo().

1238  {
1239  EXPECT_TRUE(
1240  import_test_local_geo("geospatial.csv", ", geo_coords_encoding='none'", 10, 4.5));
1241 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [52/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Encoding_GEOINT32   
)

Definition at line 1243 of file ImportTest.cpp.

References import_test_local_geo().

1243  {
1244  EXPECT_TRUE(import_test_local_geo(
1245  "geospatial.csv", ", geo_coords_encoding='compressed(32)'", 10, 4.5));
1246 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [53/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Encoding_Other   
)

Definition at line 1248 of file ImportTest.cpp.

References import_test_local_geo().

1248  {
1249  EXPECT_THROW(
1250  import_test_local_geo("geospatial.csv", ", geo_coords_encoding='other'", 10, 4.5),
1251  std::runtime_error);
1252 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [54/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_SRID_LonLat   
)

Definition at line 1254 of file ImportTest.cpp.

References import_test_local_geo().

1254  {
1255  EXPECT_TRUE(import_test_local_geo("geospatial.csv", ", geo_coords_srid=4326", 10, 4.5));
1256 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [55/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_SRID_Mercator   
)

Definition at line 1258 of file ImportTest.cpp.

References import_test_local_geo().

1258  {
1259  EXPECT_TRUE(
1260  import_test_local_geo("geospatial.csv", ", geo_coords_srid=900913", 10, 4.5));
1261 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [56/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_SRID_Other   
)

Definition at line 1263 of file ImportTest.cpp.

References import_test_local_geo().

1263  {
1264  EXPECT_THROW(
1265  import_test_local_geo("geospatial.csv", ", geo_coords_srid=12345", 10, 4.5),
1266  std::runtime_error);
1267 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:173
+ Here is the call graph for this function:

◆ TEST_F() [57/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_Point_Import   
)

Definition at line 1280 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1280  {
1282  const auto file_path =
1283  boost::filesystem::path("geospatial_point/geospatial_point.geojson");
1284  import_test_geofile_importer(file_path.string(), "geospatial", false);
1286 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [58/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Import   
)

Definition at line 1288 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1288  {
1290  const auto file_path =
1291  boost::filesystem::path("geospatial_mpoly/geospatial_mpoly.geojson");
1292  import_test_geofile_importer(file_path.string(), "geospatial", false);
1294  check_geo_num_rows("omnisci_geo, trip", 10);
1295 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [59/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Import_Empties   
)

Definition at line 1297 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1297  {
1299  const auto file_path =
1300  boost::filesystem::path("geospatial_mpoly/geospatial_mpoly_empties.geojson");
1301  import_test_geofile_importer(file_path.string(), "geospatial", false);
1303  check_geo_num_rows("omnisci_geo, trip", 8); // we expect it to drop 2 of the 10 rows
1304 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [60/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Import_Degenerate   
)

Definition at line 1306 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_import(), anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1306  {
1308  const auto file_path =
1309  boost::filesystem::path("geospatial_mpoly/geospatial_mpoly_degenerate.geojson");
1310  import_test_geofile_importer(file_path.string(), "geospatial", false);
1312  check_geo_num_rows("omnisci_geo, trip", 8); // we expect it to drop 2 of the 10 rows
1313 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [61/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_Point_Import   
)

Definition at line 1315 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1315  {
1317  const auto file_path = boost::filesystem::path("geospatial_point/geospatial_point.shp");
1318  import_test_geofile_importer(file_path.string(), "geospatial", false);
1320 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [62/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_MultiPolygon_Import   
)

Definition at line 1322 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1322  {
1324  const auto file_path = boost::filesystem::path("geospatial_mpoly/geospatial_mpoly.shp");
1325  import_test_geofile_importer(file_path.string(), "geospatial", false);
1327 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [63/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_Point_Import_Compressed   
)

Definition at line 1329 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_tv_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1329  {
1331  const auto file_path = boost::filesystem::path("geospatial_point/geospatial_point.shp");
1332  import_test_geofile_importer(file_path.string(), "geospatial", true);
1334 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [64/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_MultiPolygon_Import_Compressed   
)

Definition at line 1336 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_tv_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1336  {
1338  const auto file_path = boost::filesystem::path("geospatial_mpoly/geospatial_mpoly.shp");
1339  import_test_geofile_importer(file_path.string(), "geospatial", true);
1341 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [65/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_Point_Import_3857   
)

Definition at line 1343 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_point_tv_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1343  {
1345  const auto file_path =
1346  boost::filesystem::path("geospatial_point/geospatial_point_3857.shp");
1347  import_test_geofile_importer(file_path.string(), "geospatial", false);
1349 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [66/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_MultiPolygon_Import_3857   
)

Definition at line 1351 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_gdal_mpoly_tv_import(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1351  {
1353  const auto file_path =
1354  boost::filesystem::path("geospatial_mpoly/geospatial_mpoly_3857.shp");
1355  import_test_geofile_importer(file_path.string(), "geospatial", false);
1357 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [67/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Append   
)

Definition at line 1359 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1359  {
1361  const auto file_path =
1362  boost::filesystem::path("geospatial_mpoly/geospatial_mpoly.geojson");
1363  import_test_geofile_importer(file_path.string(), "geospatial", false);
1364  check_geo_num_rows("omnisci_geo, trip", 10);
1365  ASSERT_NO_THROW(
1366  import_test_geofile_importer(file_path.string(), "geospatial", false, false));
1367  check_geo_num_rows("omnisci_geo, trip", 20);
1368 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [68/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geodatabase_Simple   
)

Definition at line 1370 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), import_test_geofile_importer(), and SKIP_ALL_ON_AGGREGATOR.

1370  {
1372  const auto file_path =
1373  boost::filesystem::path("geodatabase/S_USA.Experimental_Area_Locations.gdb.zip");
1374  import_test_geofile_importer(file_path.string(), "geospatial", false);
1375  check_geo_num_rows("omnisci_geo, ESTABLISHED", 87);
1376 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
+ Here is the call graph for this function:

◆ TEST_F() [69/69]

anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
KML_Simple   
)

Definition at line 1378 of file ImportTest.cpp.

References anonymous_namespace{ImportTest.cpp}::anonymous_namespace{ImportTest.cpp}::check_geo_num_rows(), logger::ERROR, Importer_NS::Importer::hasGDALLibKML(), import_test_common(), import_test_common_geo(), import_test_geofile_importer(), LOG, and SKIP_ALL_ON_AGGREGATOR.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTest::TearDown().

1378  {
1381  LOG(ERROR) << "Test requires LibKML support in GDAL";
1382  } else {
1383  const auto file_path = boost::filesystem::path("KML/test.kml");
1384  import_test_geofile_importer(file_path.string(), "geospatial", false);
1385  check_geo_num_rows("omnisci_geo, FID", 10);
1386  }
1387 }
void import_test_geofile_importer(const std::string &file_str, const std::string &table_name, const bool compression, const bool create_table=true)
Definition: ImportTest.cpp:146
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
#define LOG(tag)
Definition: Logger.h:182
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:52
static bool hasGDALLibKML()
Definition: Importer.cpp:4013
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_minisort_on_column()

void anonymous_namespace{ImportTest.cpp}::test_minisort_on_column ( const std::string &  column_name,
const std::vector< int >  expects 
)

Definition at line 351 of file ImportTest.cpp.

References check_minisort_on_expects(), and create_minisort_table_on_column().

Referenced by TEST_F().

352  {
353  create_minisort_table_on_column(column_name);
354  check_minisort_on_expects("sortab", expects);
355 }
void check_minisort_on_expects(const std::string &table_name, const std::vector< int > &expects)
Definition: ImportTest.cpp:340
void create_minisort_table_on_column(const std::string &column_name)
Definition: ImportTest.cpp:331
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_minisort_on_column_with_ctas()

void anonymous_namespace{ImportTest.cpp}::test_minisort_on_column_with_ctas ( const std::string &  column_name,
const std::vector< int >  expects 
)

Definition at line 364 of file ImportTest.cpp.

References check_minisort_on_expects(), create_minisort_table_on_column(), and create_minisort_table_on_column_with_ctas().

Referenced by TEST_F().

365  {
368  check_minisort_on_expects("sortctas", expects);
369 }
void check_minisort_on_expects(const std::string &table_name, const std::vector< int > &expects)
Definition: ImportTest.cpp:340
void create_minisort_table_on_column(const std::string &column_name)
Definition: ImportTest.cpp:331
void create_minisort_table_on_column_with_ctas(const std::string &column_name)
Definition: ImportTest.cpp:357
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TypeToString()

std::string anonymous_namespace{ImportTest.cpp}::TypeToString ( SQLTypes  type)

Definition at line 264 of file ImportTest.cpp.

References SQLTypeInfoCore< TYPE_FACET_PACK >::get_type_name().

Referenced by d().

264  {
265  return SQLTypeInfo(type, false).get_type_name();
266 }
std::string get_type_name() const
Definition: sqltypes.h:426
SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities > SQLTypeInfo
Definition: sqltypes.h:823
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ create_table_date

const char* anonymous_namespace{ImportTest.cpp}::create_table_date
Initial value:
= R"(
CREATE TABLE import_test_date(
date_text TEXT ENCODING DICT(32),
date_date DATE,
date_date_not_null DATE NOT NULL,
date_i32 DATE ENCODING FIXED(32),
date_i16 DATE ENCODING FIXED(16)
);
)"

Definition at line 514 of file ImportTest.cpp.

◆ create_table_date_arr

const char* anonymous_namespace{ImportTest.cpp}::create_table_date_arr
Initial value:
= R"(
CREATE TABLE import_test_date_arr(
date_text TEXT[],
date_date DATE[],
date_date_fixed DATE[2],
date_date_not_null DATE[] NOT NULL
);
)"

Definition at line 603 of file ImportTest.cpp.

◆ create_table_mini_sort

const char* anonymous_namespace{ImportTest.cpp}::create_table_mini_sort
Initial value:
= R"(
CREATE TABLE sortab(
i int,
f float,
ia int[2],
pt point,
sa text[],
s2 text encoding dict(16),
dt date,
d2 date ENCODING FIXED(16),
tm timestamp,
t4 timestamp ENCODING FIXED(32),
va int[])
)"

Definition at line 303 of file ImportTest.cpp.

◆ create_table_mixed_varlen

const char* anonymous_namespace{ImportTest.cpp}::create_table_mixed_varlen
Initial value:
= R"(
CREATE TABLE import_test_mixed_varlen(
pt GEOMETRY(POINT),
ls GEOMETRY(LINESTRING),
faii INTEGER[2],
fadc DECIMAL(5,2)[2],
fatx TEXT[] ENCODING DICT(32),
fatx2 TEXT[2] ENCODING DICT(32)
);
)"

Definition at line 479 of file ImportTest.cpp.

◆ create_table_timestamps

const char* anonymous_namespace{ImportTest.cpp}::create_table_timestamps
Initial value:
= R"(
CREATE TABLE import_test_timestamps(
ts0_text TEXT ENCODING DICT(32),
ts3_text TEXT ENCODING DICT(32),
ts6_text TEXT ENCODING DICT(32),
ts9_text TEXT ENCODING DICT(32),
ts_0 TIMESTAMP(0),
ts_0_i32 TIMESTAMP ENCODING FIXED(32),
ts_0_not_null TIMESTAMP NOT NULL,
ts_3 TIMESTAMP(3),
ts_3_not_null TIMESTAMP(3) NOT NULL,
ts_6 TIMESTAMP(6),
ts_6_not_null TIMESTAMP(6) NOT NULL,
ts_9 TIMESTAMP(9),
ts_9_not_null TIMESTAMP(9) NOT NULL
);
)"

Definition at line 713 of file ImportTest.cpp.

◆ create_table_trips

const char* anonymous_namespace{ImportTest.cpp}::create_table_trips
Initial value:
= R"(
CREATE TABLE trips (
medallion TEXT ENCODING DICT,
hack_license TEXT ENCODING DICT,
vendor_id TEXT ENCODING DICT,
rate_code_id SMALLINT,
store_and_fwd_flag TEXT ENCODING DICT,
pickup_datetime TIMESTAMP,
dropoff_datetime TIMESTAMP,
passenger_count SMALLINT,
trip_time_in_secs INTEGER,
trip_distance DECIMAL(14,2),
pickup_longitude DECIMAL(14,2),
pickup_latitude DECIMAL(14,2),
dropoff_longitude DECIMAL(14,2),
dropoff_latitude DECIMAL(14,2)
) WITH (FRAGMENT_SIZE=75000000);
)"

Definition at line 822 of file ImportTest.cpp.

◆ create_table_trips_dict_sharded_text

const char* anonymous_namespace{ImportTest.cpp}::create_table_trips_dict_sharded_text
Initial value:
= R"(
CREATE TABLE trips (
id INTEGER,
medallion TEXT ENCODING DICT,
hack_license TEXT ENCODING DICT,
vendor_id TEXT ENCODING DICT,
rate_code_id SMALLINT,
store_and_fwd_flag TEXT ENCODING DICT,
pickup_date DATE,
drop_date DATE ENCODING FIXED(16),
pickup_datetime TIMESTAMP,
dropoff_datetime TIMESTAMP,
passenger_count SMALLINT,
trip_time_in_secs INTEGER,
trip_distance DECIMAL(14,2),
pickup_longitude DECIMAL(14,2),
pickup_latitude DECIMAL(14,2),
dropoff_longitude DECIMAL(14,2),
dropoff_latitude DECIMAL(14,2),
shard key (medallion)
) WITH (FRAGMENT_SIZE=75000000, SHARD_COUNT=2);
)"

Definition at line 1010 of file ImportTest.cpp.

◆ create_table_trips_dict_sharded_text_8bit

const char* anonymous_namespace{ImportTest.cpp}::create_table_trips_dict_sharded_text_8bit
Initial value:
= R"(
CREATE TABLE trips (
id INTEGER,
medallion TEXT ENCODING DICT (8),
hack_license TEXT ENCODING DICT,
vendor_id TEXT ENCODING DICT,
rate_code_id SMALLINT,
store_and_fwd_flag TEXT ENCODING DICT,
pickup_date DATE,
drop_date DATE ENCODING FIXED(16),
pickup_datetime TIMESTAMP,
dropoff_datetime TIMESTAMP,
passenger_count SMALLINT,
trip_time_in_secs INTEGER,
trip_distance DECIMAL(14,2),
pickup_longitude DECIMAL(14,2),
pickup_latitude DECIMAL(14,2),
dropoff_longitude DECIMAL(14,2),
dropoff_latitude DECIMAL(14,2),
shard key (medallion)
) WITH (FRAGMENT_SIZE=75000000, SHARD_COUNT=2);
)"

Definition at line 1049 of file ImportTest.cpp.

◆ create_table_trips_sharded

const char* anonymous_namespace{ImportTest.cpp}::create_table_trips_sharded
Initial value:
= R"(
CREATE TABLE trips (
id INTEGER,
medallion TEXT ENCODING DICT,
hack_license TEXT ENCODING DICT,
vendor_id TEXT ENCODING DICT,
rate_code_id SMALLINT,
store_and_fwd_flag TEXT ENCODING DICT,
pickup_date DATE,
drop_date DATE ENCODING FIXED(16),
pickup_datetime TIMESTAMP,
dropoff_datetime TIMESTAMP,
passenger_count SMALLINT,
trip_time_in_secs INTEGER,
trip_distance DECIMAL(14,2),
pickup_longitude DECIMAL(14,2),
pickup_latitude DECIMAL(14,2),
dropoff_longitude DECIMAL(14,2),
dropoff_latitude DECIMAL(14,2),
shard key (id)
) WITH (FRAGMENT_SIZE=75000000, SHARD_COUNT=2);
)"

Definition at line 971 of file ImportTest.cpp.

◆ g_aggregator

bool anonymous_namespace{ImportTest.cpp}::g_aggregator {false}

Definition at line 49 of file ImportTest.cpp.

◆ g_hoist_literals

bool anonymous_namespace{ImportTest.cpp}::g_hoist_literals {true}

Definition at line 58 of file ImportTest.cpp.

Referenced by run_query().

◆ g_num_leafs

size_t anonymous_namespace{ImportTest.cpp}::g_num_leafs {1}

Definition at line 50 of file ImportTest.cpp.