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

Namespaces

 anonymous_namespace{ImportTest.cpp}
 

Classes

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

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_line_endings_in_quotes_local (const string &filename, const int64_t cnt)
 
void import_test_with_quoted_fields (const std::string &filename, const std::string &quoted)
 
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)
 
 TEST_F (ImportTestSkipHeader, Skip_Header)
 
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, random_strings_with_line_endings)
 
 TEST_F (ImportTest, with_quoted_fields)
 
 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_trips_to_skip_header
 
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_random_strings_with_line_endings
 
const char * create_table_with_quoted_fields
 
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

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

Definition at line 61 of file ImportTest.cpp.

Function Documentation

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

Definition at line 373 of file ImportTest.cpp.

References CHECK_EQ, and anonymous_namespace{AlterColumnTest.cpp}::run_query().

Referenced by test_minisort_on_column(), and test_minisort_on_column_with_ctas().

376  {
377  ASSERT_NO_THROW(run_ddl_statement("drop table if exists sortab;"));
378  ASSERT_NO_THROW(run_ddl_statement("drop table if exists sortctas;"));
379  }
380 };
381 
382 void create_minisort_table_on_column(const std::string& column_name) {
void create_minisort_table_on_column(const std::string &column_name)
Definition: ImportTest.cpp:364
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 71 of file ImportTest.cpp.

References CHECK_EQ, logger::ERROR, LOG, and anonymous_namespace{AlterColumnTest.cpp}::run_query().

Referenced by anonymous_namespace{UpdelStorageTest.cpp}::delete_and_immediately_vacuum_rows(), import_test_common(), anonymous_namespace{UpdelStorageTest.cpp}::prepare_table_for_delete(), and anonymous_namespace{UpdelStorageTest.cpp}::update_a_numeric_column().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 552 of file ImportTest.cpp.

References d().

Referenced by run_mixed_dates_test(), and TEST_F().

553  {
554  EXPECT_NO_THROW(
555  run_ddl_statement("copy import_test_mixed_varlen from "
556  "'../../Tests/Import/datafiles/mixed_varlen.txt' with "
557  "(header='false');"));
558  std::string query_str = "SELECT COUNT(*) FROM import_test_mixed_varlen;";
559  auto rows = run_query(query_str);
560  auto crt_row = rows->getNextRow(true, true);
561  CHECK_EQ(size_t(1), crt_row.size());
562  CHECK_EQ(int64_t(1), v<int64_t>(crt_row[0]));
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 736 of file ImportTest.cpp.

References to_string().

Referenced by run_mixed_timestamps_test().

737  {
738  // Empty date array
739  CHECK(date_arr1->is_initialized());
740  const auto& vec = date_arr1->get();
741  ASSERT_EQ(size_t(0), vec.size());
742  } else {
743  // NULL array
744  CHECK(!date_arr1->is_initialized());
745  }
746  const auto date_arr2 = boost::get<ArrayTargetValue>(&crt_row[2]);
747  CHECK(date_arr2);
748  if (i == 9) {
749  // Fixlen array - not NULL, filled with NULLs
750  CHECK(date_arr2->is_initialized());
751  const auto& vec = date_arr2->get();
752  for (size_t k = 0; k < vec.size(); k++) {
753  const auto date = v<int64_t>(vec[k]);
754  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
755  ASSERT_EQ("NULL", date_str);
std::string convert_date_to_string(int64_t d)
Definition: ImportTest.cpp:552
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 364 of file ImportTest.cpp.

References create_table_mini_sort, and run_ddl_statement().

Referenced by test_minisort_on_column(), and test_minisort_on_column_with_ctas().

369  : public ::testing::Test {
370  protected:
371  void SetUp() override {

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 390 of file ImportTest.cpp.

References run_ddl_statement().

Referenced by test_minisort_on_column_with_ctas().

392  {
393  auto rows = run_query("SELECT i FROM " + table_name + ";");
394  CHECK_EQ(expects.size(), rows->rowCount());
395  for (auto exp : expects) {
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const std::string &query_str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 289 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(), 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(), 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().

289  {
290  auto detected_type = Importer_NS::Detector::detect_sqltype(str);
291  EXPECT_EQ(TypeToString(expected_type), TypeToString(detected_type))
292  << "String: " << str;
293 }
static SQLTypes detect_sqltype(const std::string &str)
Definition: Importer.cpp:2820
std::string TypeToString(SQLTypes type)
Definition: ImportTest.cpp:285

+ Here is the call graph for this function:

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

Definition at line 633 of file ImportTest.cpp.

References CHECK, and CHECK_EQ.

Referenced by TEST_F().

635  : public ::testing::Test {
636  protected:
637  void SetUp() override {
638  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date;"));
640  ASSERT_NO_THROW(run_ddl_statement(create_table_date));
641  }
642 
643  void TearDown() override {
644  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date;"));
646  }
647 };
bool g_use_date_in_days_default_encoding
Definition: ParserNode.cpp:67
void run_ddl_statement(std::string ddl)

+ Here is the caller graph for this function:

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

Definition at line 95 of file ImportTest.cpp.

References compare_agg(), and run_ddl_statement().

Referenced by import_test_local().

95  {
96  run_ddl_statement(query_str);
97  return compare_agg(cnt, avg);
98 }
bool compare_agg(const int64_t cnt, const double avg)
Definition: ImportTest.cpp:71
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 147 of file ImportTest.cpp.

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

Referenced by TEST_F().

150  {
151  Importer_NS::ImportDriver import_driver(QR::get()->getCatalog(),
152  QR::get()->getSession()->get_currentUser(),
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:118

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 173 of file ImportTest.cpp.

References CHECK_EQ, run_ddl_statement(), and anonymous_namespace{AlterColumnTest.cpp}::run_query().

Referenced by TEST_F().

173  {
174  string query_str =
175  "COPY random_strings_with_line_endings FROM '../../Tests/Import/datafiles/" +
176  filename +
177  "' WITH (header='false', quoted='true', max_reject=1, buffer_size=1048576);";
178  run_ddl_statement(query_str);
179  std::string select_query_str = "SELECT COUNT(*) FROM random_strings_with_line_endings;";
180  auto rows = run_query(select_query_str);
181  auto crt_row = rows->getNextRow(true, true);
182  CHECK_EQ(size_t(1), crt_row.size());
183  auto r_cnt = v<int64_t>(crt_row[0]);
184  return r_cnt == cnt;
185 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 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:95

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 194 of file ImportTest.cpp.

References import_test_common_geo().

Referenced by TEST_F().

197  {
198  return import_test_common_geo(string("COPY geo FROM '") +
199  "../../Tests/Import/datafiles/" + filename +
200  "' WITH (geo='true'" + other_options + ");",
201  "geo",
202  cnt,
203  avg);
204 }
bool import_test_common_geo(const string &query_str, const std::string &table, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:100

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{ImportTest.cpp}::import_test_with_quoted_fields ( const std::string &  filename,
const std::string &  quoted 
)

Definition at line 187 of file ImportTest.cpp.

References run_ddl_statement().

Referenced by TEST_F().

188  {
189  string query_str = "COPY with_quoted_fields FROM '../../Tests/Import/datafiles/" +
190  filename + "' WITH (header='true', quoted='" + quoted + "');";
191  run_ddl_statement(query_str);
192 }
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 63 of file ImportTest.cpp.

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

63  {
64  QR::get()->runDDLStatement(input_str);
65 }
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:118

+ Here is the call graph for this function:

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

Definition at line 564 of file ImportTest.cpp.

References CHECK, convert_date_to_string(), run_ddl_statement(), and anonymous_namespace{AlterColumnTest.cpp}::run_query().

Referenced by TEST_F().

575  : public ::testing::Test {
576  protected:
577  void SetUp() override {
578  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date;"));
579  ASSERT_NO_THROW(run_ddl_statement(create_table_date));
580  }
581 
582  void TearDown() override {
583  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date;"));
584  }
585 };
586 
587 std::string convert_date_to_string(int64_t d) {
588  if (d == std::numeric_limits<int64_t>::min()) {
589  return std::string("NULL");
590  }
591  const auto date = static_cast<time_t>(d);
592  std::tm tm_struct;
593  gmtime_r(&date, &tm_struct);
std::string convert_date_to_string(int64_t d)
Definition: ImportTest.cpp:552
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:289
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 757 of file ImportTest.cpp.

References CHECK, convert_timestamp_to_string(), run_ddl_statement(), and anonymous_namespace{AlterColumnTest.cpp}::run_query().

Referenced by TEST_F().

757  {
758  // NULL fixlen array
759  CHECK(!date_arr2->is_initialized());
760  }
761  }
762 }
763 
764 const char* create_table_timestamps = 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 ); )";
765 
766 class ImportTestTimestamps : public ::testing::Test {
767  protected:
768  void SetUp() override {
769  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_timestamps;"));
770  ASSERT_NO_THROW(run_ddl_statement(create_table_timestamps));
771  }
772 
773  void TearDown() override {
774  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date;"));
775  }
776 };
777 
778 std::string convert_timestamp_to_string(const time_t timeval, const int dimen) {
779  std::tm tm_struct;
780  if (dimen > 0) {
781  auto scale = static_cast<int64_t>(std::pow(10, dimen));
782  auto dv = std::div(static_cast<int64_t>(timeval), scale);
783  auto modulus = (dv.rem + scale) % scale;
784  time_t sec = dv.quot - (dv.quot < 0 && modulus > 0);
785  gmtime_r(&sec, &tm_struct);
786  char buf[21];
787  strftime(buf, 21, "%F %T.", &tm_struct);
788  auto subsecond = std::to_string(modulus);
789  return std::string(buf) + std::string(dimen - subsecond.length(), '0') + subsecond;
790  } else {
791  time_t sec = timeval;
792  gmtime_r(&sec, &tm_struct);
793  char buf[20];
794 
std::string to_string(char const *&&v)
#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:736

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 67 of file ImportTest.cpp.

References CPU, anonymous_namespace{AlterColumnTest.cpp}::g_hoist_literals, QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runSQL().

67  {
69 }
virtual std::shared_ptr< ResultSet > runSQL(const std::string &query_str, const ExecutorDeviceType device_type, const bool hoist_literals=true, const bool allow_loop_joins=true)
static QueryRunner * get()
Definition: QueryRunner.h:118

+ Here is the call graph for this function:

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

Definition at line 295 of file ImportTest.cpp.

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

295  {
296  d(kDATE, "2016-01-02");
297  d(kDATE, "02/01/2016");
298  d(kDATE, "01-Feb-16");
299  d(kDATE, "01/Feb/2016");
300  d(kDATE, "01/Feb/16");
301  d(kTIMESTAMP, "2016-01-02T03:04");
302  d(kTIMESTAMP, "2016-01-02T030405");
303  d(kTIMESTAMP, "2016-01-02T03:04:05");
304  d(kTIMESTAMP, "1776-01-02T03:04:05");
305  d(kTIMESTAMP, "9999-01-02T03:04:05");
306  d(kTIME, "03:04");
307  d(kTIME, "03:04:05");
308  d(kTEXT, "33:04");
309 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:289
Definition: sqltypes.h:52
Definition: sqltypes.h:55
Definition: sqltypes.h:56

+ Here is the call graph for this function:

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

Definition at line 311 of file ImportTest.cpp.

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

311  {
312  d(kSMALLINT, "1");
313  d(kSMALLINT, "12345");
314  d(kINT, "123456");
315  d(kINT, "1234567890");
316  d(kBIGINT, "12345678901");
317  d(kFLOAT, "1.");
318  d(kFLOAT, "1.2345678");
319  // d(kDOUBLE, "1.2345678901");
320  // d(kDOUBLE, "1.23456789012345678901234567890");
321  d(kTEXT, "1.22.22");
322 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:289
Definition: sqltypes.h:55
Definition: sqltypes.h:48

+ Here is the call graph for this function:

anonymous_namespace{ImportTest.cpp}::TEST_F ( ImportTestSkipHeader  ,
Skip_Header   
)

Definition at line 336 of file ImportTest.cpp.

References g_archive_read_buf_size, and import_test_local().

338  { ASSERT_NO_THROW(run_ddl_statement("drop table trips;");); }
339 };
340 
341 TEST_F(ImportTestSkipHeader, Skip_Header) {
342  // save existing size and restore it after test so that changing it to a tiny size
343  // of 10 below for this test won't affect performance of other tests.
344  const auto archive_read_buf_size_state = g_archive_read_buf_size;
345  // 10 makes sure that the first block returned by PosixFileArchive::read_data_block
346  // does not contain the first line delimiter
TEST_F(AlterColumnTest, Add_column_with_default)
size_t g_archive_read_buf_size
Definition: Importer.cpp:74
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

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

Definition at line 404 of file ImportTest.cpp.

References test_minisort_on_column().

+ Here is the call graph for this function:

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

Definition at line 408 of file ImportTest.cpp.

References test_minisort_on_column().

408  {
409  EXPECT_NO_THROW(
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

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

Definition at line 412 of file ImportTest.cpp.

References test_minisort_on_column().

412  : ";")););
413 }
414 

+ Here is the call graph for this function:

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

Definition at line 416 of file ImportTest.cpp.

References test_minisort_on_column().

416  {
void create_minisort_table_on_column(const std::string &column_name)
Definition: ImportTest.cpp:364
void create_minisort_table_on_column_with_ctas(const std::string &column_name)
Definition: ImportTest.cpp:390

+ Here is the call graph for this function:

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

Definition at line 420 of file ImportTest.cpp.

References test_minisort_on_column().

422  {

+ Here is the call graph for this function:

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

Definition at line 424 of file ImportTest.cpp.

References test_minisort_on_column().

426  {

+ Here is the call graph for this function:

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

Definition at line 428 of file ImportTest.cpp.

References test_minisort_on_column().

430  {

+ Here is the call graph for this function:

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

Definition at line 432 of file ImportTest.cpp.

References test_minisort_on_column().

434  {

+ Here is the call graph for this function:

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

Definition at line 436 of file ImportTest.cpp.

References test_minisort_on_column().

438  {

+ Here is the call graph for this function:

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

Definition at line 440 of file ImportTest.cpp.

References test_minisort_on_column().

442  {

+ Here is the call graph for this function:

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

Definition at line 444 of file ImportTest.cpp.

References test_minisort_on_column().

446  {

+ Here is the call graph for this function:

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

Definition at line 448 of file ImportTest.cpp.

References test_minisort_on_column().

450  {

+ Here is the call graph for this function:

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

Definition at line 452 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

454  {
455  test_minisort_on_column("tm", {1, 2, 3, 4, 5});
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:384

+ Here is the call graph for this function:

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

Definition at line 457 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

458  {
459  test_minisort_on_column("t4", {1, 2, 3, 4, 5});
460 }
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:384

+ Here is the call graph for this function:

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

Definition at line 462 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

462  {
463  test_minisort_on_column("va", {1, 2, 3, 4, 5});
464 }
465 
void test_minisort_on_column(const std::string &column_name, const std::vector< int > expects)
Definition: ImportTest.cpp:384

+ Here is the call graph for this function:

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

Definition at line 467 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

467  {2, 3, 4, 5, 1});
468 }
469 
470 TEST_F(ImportTestMiniSort, ctas_on_none) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 472 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

472  {5, 3, 1, 2, 4});
473 }
474 
475 TEST_F(ImportTestMiniSort, ctas_on_int) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 477 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

477  {1, 2, 3, 4, 5});
478 }
479 
480 TEST_F(ImportTestMiniSort, ctas_on_float) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 482 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

482  {1, 2, 3, 4, 5});
483 }
484 
485 TEST_F(ImportTestMiniSort, ctas_on_int_array) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 487 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

487  {1, 2, 3, 4, 5});
488 }
489 
490 TEST_F(ImportTestMiniSort, ctas_on_string_array) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 492 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

492  {5, 3, 1, 2, 4});
493 }
494 
495 TEST_F(ImportTestMiniSort, ctas_on_string_2b) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 497 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

497  {5, 3, 1, 2, 4});
498 }
499 
500 TEST_F(ImportTestMiniSort, ctas_on_date) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 502 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

502  {1, 2, 3, 4, 5});
503 }
504 
505 TEST_F(ImportTestMiniSort, ctas_on_date_2b) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 507 of file ImportTest.cpp.

References SKIP_ALL_ON_AGGREGATOR, and test_minisort_on_column_with_ctas().

507  {1, 2, 3, 4, 5});
508 }
509 
510 TEST_F(ImportTestMiniSort, ctas_on_time) {
TEST_F(AlterColumnTest, Add_column_with_default)

+ Here is the call graph for this function:

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

Definition at line 526 of file ImportTest.cpp.

References CHECK_EQ, run_ddl_statement(), and anonymous_namespace{AlterColumnTest.cpp}::run_query().

527  {2, 3, 4, 5, 1});
528 }
529 
530 const char* create_table_mixed_varlen = 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),

+ Here is the call graph for this function:

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

Definition at line 595 of file ImportTest.cpp.

References run_mixed_dates_test(), and SKIP_ALL_ON_AGGREGATOR.

599  {

+ Here is the call graph for this function:

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

Definition at line 614 of file ImportTest.cpp.

References run_mixed_dates_test(), and SKIP_ALL_ON_AGGREGATOR.

621  {

+ Here is the call graph for this function:

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

Definition at line 649 of file ImportTest.cpp.

References CHECK, convert_date_to_string(), decode_str_array(), run_ddl_statement(), and anonymous_namespace{AlterColumnTest.cpp}::run_query().

649  {
650  SKIP_ALL_ON_AGGREGATOR(); // global variable not available on leaf nodes
652 }
653 
654 const char* create_table_date_arr = 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 ); )";
655 
656 class ImportTestDateArray : public ::testing::Test {
657  protected:
658  void SetUp() override {
659  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date_arr;"));
660  ASSERT_NO_THROW(run_ddl_statement(create_table_date_arr));
661  }
662 
663  void TearDown() override {
664  ASSERT_NO_THROW(run_ddl_statement("drop table if exists import_test_date_arr;"));
665  }
666 };
667 
668 void decode_str_array(const TargetValue& r, std::vector<std::string>& arr) {
669  const auto atv = boost::get<ArrayTargetValue>(&r);
670  CHECK(atv);
671  if (!atv->is_initialized()) {
672  return;
673  }
674  const auto& vec = atv->get();
675  for (const auto& stv : vec) {
676  const auto ns = v<NullableString>(stv);
677  const auto str = boost::get<std::string>(&ns);
678  CHECK(str);
679  arr.push_back(*str);
680  }
681  CHECK_EQ(arr.size(), vec.size());
682 }
683 
684 TEST_F(ImportTestDateArray, ImportMixedDateArrays) {
685  EXPECT_NO_THROW(
686  run_ddl_statement("COPY import_test_date_arr FROM "
687  "'../../Tests/Import/datafiles/mixed_date_arrays.txt';"));
688 
689  auto rows = run_query("SELECT * FROM import_test_date_arr;");
690  ASSERT_EQ(size_t(10), rows->entryCount());
691  for (size_t i = 0; i < 3; i++) {
692  const auto crt_row = rows->getNextRow(true, true);
693  ASSERT_EQ(size_t(4), crt_row.size());
694  std::vector<std::string> truth_arr;
695  decode_str_array(crt_row[0], truth_arr);
696  for (size_t j = 1; j < crt_row.size(); j++) {
697  const auto date_arr = boost::get<ArrayTargetValue>(&crt_row[j]);
698  CHECK(date_arr && date_arr->is_initialized());
699  const auto& vec = date_arr->get();
700  for (size_t k = 0; k < vec.size(); k++) {
701  const auto date = v<int64_t>(vec[k]);
702  const auto date_str = convert_date_to_string(static_cast<int64_t>(date));
703  ASSERT_EQ(truth_arr[k], date_str);
704  }
705  }
706  }
707  // Date arrays with NULL dates
708  for (size_t i = 3; i < 6; i++) {
709  const auto crt_row = rows->getNextRow(true, true);
710  ASSERT_EQ(size_t(4), crt_row.size());
711  std::vector<std::string> truth_arr;
712  decode_str_array(crt_row[0], truth_arr);
713  for (size_t j = 1; j < crt_row.size() - 1; j++) {
714 
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::string convert_date_to_string(int64_t d)
Definition: ImportTest.cpp:552
TEST_F(AlterColumnTest, Add_column_with_default)
void decode_str_array(const TargetValue &r, std::vector< std::string > &arr)
Definition: ImportTest.cpp:633
#define SKIP_ALL_ON_AGGREGATOR()
Definition: ImportTest.cpp:53
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
#define CHECK(condition)
Definition: Logger.h:187
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue
Definition: TargetValue.h:167
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

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

Definition at line 811 of file ImportTest.cpp.

References run_mixed_timestamps_test().

815  {

+ Here is the call graph for this function:

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

Definition at line 909 of file ImportTest.cpp.

References import_test_local().

909  : public ::testing::Test {
910  protected:
911  void SetUp() override {

+ Here is the call graph for this function:

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

Definition at line 913 of file ImportTest.cpp.

References import_test_line_endings_in_quotes_local().

921  {

+ Here is the call graph for this function:

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

Definition at line 919 of file ImportTest.cpp.

References import_test_with_quoted_fields().

921  {
922  ASSERT_NO_THROW(run_ddl_statement("drop table trips;"););
923  ASSERT_NO_THROW(run_ddl_statement("drop table random_strings_with_line_endings;"););
924  ASSERT_NO_THROW(run_ddl_statement("drop table with_quoted_fields;"););
925  ASSERT_NO_THROW(run_ddl_statement("drop table if exists geo;"););
926  }
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

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

Definition at line 928 of file ImportTest.cpp.

References import_test_local().

931  {

+ Here is the call graph for this function:

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

Definition at line 932 of file ImportTest.cpp.

References import_test_local().

935  {

+ Here is the call graph for this function:

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

Definition at line 936 of file ImportTest.cpp.

References import_test_local().

943  {

+ Here is the call graph for this function:

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

Definition at line 940 of file ImportTest.cpp.

References import_test_local().

943  {

+ Here is the call graph for this function:

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

Definition at line 944 of file ImportTest.cpp.

References import_test_local().

950  {

+ Here is the call graph for this function:

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

Definition at line 948 of file ImportTest.cpp.

References import_test_local().

950  {

+ Here is the call graph for this function:

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

Definition at line 952 of file ImportTest.cpp.

References import_test_local().

954  {

+ Here is the call graph for this function:

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

Definition at line 956 of file ImportTest.cpp.

References import_test_local().

957  {
958  EXPECT_TRUE(import_test_local_parquet_with_geo_point(

+ Here is the call graph for this function:

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

Definition at line 960 of file ImportTest.cpp.

References import_test_local().

966  {

+ Here is the call graph for this function:

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

Definition at line 964 of file ImportTest.cpp.

References import_test_local().

966  {

+ Here is the call graph for this function:

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

Definition at line 968 of file ImportTest.cpp.

References import_test_local().

973  {

+ Here is the call graph for this function:

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

Definition at line 987 of file ImportTest.cpp.

References import_test_local().

987  ://omnisci_ficticiousbucket/';"),
988  std::runtime_error);
989 }

+ Here is the call graph for this function:

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

Definition at line 1005 of file ImportTest.cpp.

References import_test_local().

1007  {

+ Here is the call graph for this function:

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

Definition at line 1023 of file ImportTest.cpp.

References import_test_local().

1024  {
1025  EXPECT_TRUE(import_test_local("trip_data_no_newline_*.csv", 200, 1.0));
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:

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

Definition at line 1132 of file ImportTest.cpp.

1135  {
1136  EXPECT_TRUE(import_test_local("sharded_trip_data_9.csv", 100, 1.0));
1137 }
1138 
bool import_test_local(const string &filename, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:163
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
CSV_Import_Empties   
)

Definition at line 1140 of file ImportTest.cpp.

1161  : public ::testing::Test {
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
CSV_Import_Degenerate   
)

Definition at line 1149 of file ImportTest.cpp.

References import_test_local_geo().

1161  : public ::testing::Test {

+ Here is the call graph for this function:

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

Definition at line 1160 of file ImportTest.cpp.

1161  : public ::testing::Test {
1162  protected:
1163  void SetUp() override {
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Type_Geography   
)

Definition at line 1165 of file ImportTest.cpp.

1168  {
1169  ASSERT_NO_THROW(run_ddl_statement("drop table trips;"););
void run_ddl_statement(std::string ddl)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoImportTest  ,
Geo_CSV_Local_Type_Other   
)

Definition at line 1171 of file ImportTest.cpp.

References import_test_local_geo().

1174  {
1175  EXPECT_TRUE(import_test_local("sharded_trip_data_9.csv", 100, 1.0));
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:

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

Definition at line 1177 of file ImportTest.cpp.

References import_test_local_geo().

1178  {
1179 const char* create_table_geo = R"( CREATE TABLE geospatial (

+ Here is the call graph for this function:

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

Definition at line 1182 of file ImportTest.cpp.

References import_test_local_geo().

1192  {

+ Here is the call graph for this function:

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

Definition at line 1187 of file ImportTest.cpp.

References import_test_local_geo().

1192  {

+ Here is the call graph for this function:

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

Definition at line 1193 of file ImportTest.cpp.

References run_ddl_statement().

+ Here is the call graph for this function:

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

Definition at line 1197 of file ImportTest.cpp.

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

Definition at line 1202 of file ImportTest.cpp.

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

Definition at line 1219 of file ImportTest.cpp.

1221  {
1222  auto rows = run_query("SELECT omnisci_geo, trip FROM geospatial WHERE trip = 1.0");
1223  auto crt_row = rows->getNextRow(true, true);
1224  CHECK_EQ(size_t(2), crt_row.size());
1225  const auto point = boost::get<std::string>(v<NullableString>(crt_row[0]));
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Import   
)

Definition at line 1227 of file ImportTest.cpp.

1231  {
1232  auto rows = run_query("SELECT omnisci_geo, trip FROM geospatial WHERE trip = 1.0");
1233  auto crt_row = rows->getNextRow(true, true);
1234  CHECK_EQ(size_t(2), crt_row.size());
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Import_Empties   
)

Definition at line 1236 of file ImportTest.cpp.

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

Definition at line 1245 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.

1248  {
1249  auto rows = run_query("SELECT omnisci_geo, trip FROM geospatial WHERE trip = 1.0");
1250  rows->setGeoReturnType(ResultSet::GeoReturnType::GeoTargetValue);
1251  auto crt_row = rows->getNextRow(true, true);
1252  compare_geo_target(crt_row[0], GeoPointTargetValue({1.0, 1.0}), 1e-7);
void compare_geo_target(const TargetValue &r, const T &geo_truth_target, const double tol=-1.)
Definition: TestHelpers.h:127
std::shared_ptr< ResultSet > run_query(const std::string &query_str)

+ Here is the call graph for this function:

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

Definition at line 1254 of file ImportTest.cpp.

1257  {
1258  auto rows = run_query("SELECT omnisci_geo, trip FROM geospatial WHERE trip = 1.0");
1259  rows->setGeoReturnType(ResultSet::GeoReturnType::GeoTargetValue);
std::shared_ptr< ResultSet > run_query(const std::string &query_str)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_MultiPolygon_Import   
)

Definition at line 1261 of file ImportTest.cpp.

1262  {0.0, 0.0, 2.0, 0.0, 0.0, 2.0}, {3}, {1}),
1263  1e-7);
1264  const auto trip_distance = v<double>(crt_row[1]);
1265  ASSERT_NEAR(1.0, trip_distance, 1e-7);
1266 }
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_Point_Import_Compressed   
)

Definition at line 1268 of file ImportTest.cpp.

1270  : public ::testing::Test {
1271  protected:
1272  void SetUp() override {
1273  ASSERT_NO_THROW(run_ddl_statement("drop table if exists geospatial;"););
void run_ddl_statement(std::string ddl)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Shapefile_MultiPolygon_Import_Compressed   
)

Definition at line 1275 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.

1277  {
1278  ASSERT_NO_THROW(run_ddl_statement("drop table geospatial;"););
1279  ASSERT_NO_THROW(run_ddl_statement("drop table if exists geospatial;"););
1280  }
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

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

Definition at line 1282 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.

1283  {
1284  const auto file_path =
1285  boost::filesystem::path("../../Tests/Import/datafiles/geospatial.csv");
1286  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1287  check_geo_import();
1288  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance", 10);
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:

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

Definition at line 1290 of file ImportTest.cpp.

1291  {
1292  const auto file_path =
1293  boost::filesystem::path("../../Tests/Import/datafiles/geospatial_empties.csv");
1294  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1295  check_geo_import();
1296  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance",
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
void run_ddl_statement(std::string ddl)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geojson_MultiPolygon_Append   
)

Definition at line 1298 of file ImportTest.cpp.

1300  {
1301  const auto file_path =
1302  boost::filesystem::path("../../Tests/Import/datafiles/geospatial_degenerate.csv");
1303  run_ddl_statement("COPY geospatial FROM '" + file_path.string() + "';");
1304  check_geo_import();
1305  check_geo_num_rows("p1, l, poly, mpoly, p2, p3, p4, trip_distance",
1306  6); // we expect it to drop the 4 rows containing degenerate polys
1307 }
void check_geo_num_rows(const std::string &project_columns, const size_t num_expected_rows)
void run_ddl_statement(std::string ddl)
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
Geodatabase_Simple   
)

Definition at line 1309 of file ImportTest.cpp.

1311  {
1312  EXPECT_TRUE(
1313  import_test_local_geo("geospatial.csv", ", geo_coords_type='geometry'", 10, 4.5));
1314 }
1315 
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:194
anonymous_namespace{ImportTest.cpp}::TEST_F ( GeoGDALImportTest  ,
KML_Simple   
)

Definition at line 1317 of file ImportTest.cpp.

1322  {
1323  EXPECT_THROW(
1324  import_test_local_geo("geospatial.csv", ", geo_coords_type='other'", 10, 4.5),
1325  std::runtime_error);
1326 }
bool import_test_local_geo(const string &filename, const string &other_options, const int64_t cnt, const double avg)
Definition: ImportTest.cpp:194
void anonymous_namespace{ImportTest.cpp}::test_minisort_on_column ( const std::string &  column_name,
const std::vector< int >  expects 
)

Definition at line 384 of file ImportTest.cpp.

References check_minisort_on_expects(), and create_minisort_table_on_column().

Referenced by TEST_F().

385  : ";")));
386  EXPECT_NO_THROW(
387  run_ddl_statement("copy sortab from '../../Tests/Import/datafiles/mini_sort.txt' "
388  "with (header='false');"));
void run_ddl_statement(std::string ddl)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 397 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 285 of file ImportTest.cpp.

References SQLTypeInfoCore< TYPE_FACET_PACK >::get_type_name().

Referenced by d().

285  {
286  return SQLTypeInfo(type, false).get_type_name();
287 }
std::string get_type_name() const
Definition: sqltypes.h:427
SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities > SQLTypeInfo
Definition: sqltypes.h:845

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

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 538 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestDate::SetUp(), and anonymous_namespace{ImportTest.cpp}::ImportTestLegacyDate::SetUp().

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 619 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestDateArray::SetUp().

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 349 of file ImportTest.cpp.

Referenced by create_minisort_table_on_column().

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 512 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestMixedVarlen::SetUp().

const char* anonymous_namespace{ImportTest.cpp}::create_table_random_strings_with_line_endings
Initial value:
= R"( CREATE TABLE random_strings_with_line_endings ( random_string TEXT ) WITH (FRAGMENT_SIZE=75000000); )"

Definition at line 817 of file ImportTest.cpp.

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

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 722 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestTimestamps::SetUp().

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 815 of file ImportTest.cpp.

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 991 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestShardedText::SetUp().

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 1009 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestShardedText8::SetUp().

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 973 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestSharded::SetUp().

const char* anonymous_namespace{ImportTest.cpp}::create_table_trips_to_skip_header
Initial value:
= R"( CREATE TABLE trips ( trip_distance DECIMAL(14,2), random_string TEXT ); )"

Definition at line 324 of file ImportTest.cpp.

Referenced by anonymous_namespace{ImportTest.cpp}::ImportTestSkipHeader::SetUp().

const char* anonymous_namespace{ImportTest.cpp}::create_table_with_quoted_fields
Initial value:
= R"( CREATE TABLE with_quoted_fields ( id INTEGER, dt1 DATE ENCODING DAYS(32), str1 TEXT, bool1 BOOLEAN, smallint1 SMALLINT, ts0 TIMESTAMP ) WITH (FRAGMENT_SIZE=75000000); )"

Definition at line 819 of file ImportTest.cpp.

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

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

Definition at line 50 of file ImportTest.cpp.

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

Definition at line 59 of file ImportTest.cpp.

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

Definition at line 51 of file ImportTest.cpp.