OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::CopyTableStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::CopyTableStmt:
+ Collaboration diagram for Parser::CopyTableStmt:

Public Member Functions

 CopyTableStmt (std::string *t, std::string *f, std::list< NameValueAssign * > *o)
 
void execute (const Catalog_Namespace::SessionInfo &session) override
 
void execute (const Catalog_Namespace::SessionInfo &session, const std::function< std::unique_ptr< import_export::Importer >(Catalog_Namespace::Catalog &, const TableDescriptor *, const std::string &, const import_export::CopyParams &)> &importer_factory)
 
std::string & get_table () const
 
bool get_success () const
 
bool was_geo_copy_from () const
 
void get_geo_copy_from_payload (std::string &geo_copy_from_table, std::string &geo_copy_from_file_name, import_export::CopyParams &geo_copy_from_copy_params, std::string &geo_copy_from_partitions)
 
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Public Attributes

std::unique_ptr< std::string > return_message
 

Private Attributes

std::unique_ptr< std::string > table
 
std::unique_ptr< std::string > file_pattern
 
bool success
 
std::list< std::unique_ptr
< NameValueAssign > > 
options
 
bool _was_geo_copy_from = false
 
std::string _geo_copy_from_file_name
 
import_export::CopyParams _geo_copy_from_copy_params
 
std::string _geo_copy_from_partitions
 

Detailed Description

Definition at line 1428 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::CopyTableStmt::CopyTableStmt ( std::string *  t,
std::string *  f,
std::list< NameValueAssign * > *  o 
)
inline

Definition at line 1430 of file ParserNode.h.

References options.

1431  : table(t), file_pattern(f), success(true) {
1432  if (o) {
1433  for (const auto e : *o) {
1434  options.emplace_back(e);
1435  }
1436  delete o;
1437  }
1438  }
std::list< std::unique_ptr< NameValueAssign > > options
Definition: ParserNode.h:1472
std::unique_ptr< std::string > table
Definition: ParserNode.h:1469
std::unique_ptr< std::string > file_pattern
Definition: ParserNode.h:1470

Member Function Documentation

void Parser::CopyTableStmt::execute ( const Catalog_Namespace::SessionInfo session)
overridevirtual

Implements Parser::DDLStmt.

Definition at line 3557 of file ParserNode.cpp.

Referenced by DBHandler::execute_distributed_copy_statement(), and QueryRunner::QueryRunner::runImport().

3557  {
3558  auto importer_factory = [](Catalog_Namespace::Catalog& catalog,
3559  const TableDescriptor* td,
3560  const std::string& file_path,
3561  const import_export::CopyParams& copy_params) {
3562  return std::make_unique<import_export::Importer>(catalog, td, file_path, copy_params);
3563  };
3564  return execute(session, importer_factory);
3565 }
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:86
void execute(const Catalog_Namespace::SessionInfo &session) override
specifies the content in-memory of a row in the table metadata table

+ Here is the caller graph for this function:

void Parser::CopyTableStmt::execute ( const Catalog_Namespace::SessionInfo session,
const std::function< std::unique_ptr< import_export::Importer >(Catalog_Namespace::Catalog &, const TableDescriptor *, const std::string &, const import_export::CopyParams &)> &  importer_factory 
)

Definition at line 3567 of file ParserNode.cpp.

References import_export::CopyParams::array_begin, import_export::CopyParams::array_delim, import_export::CopyParams::array_end, Parser::anonymous_namespace{ParserNode.cpp}::bool_from_string_literal(), import_export::CopyParams::buffer_size, CHECK(), import_export::DELIMITED, import_export::CopyParams::delimiter, logger::ERROR, import_export::CopyParams::escape, measure< TimeT >::execution(), legacylockmgr::ExecutorOuterLock, import_export::CopyParams::file_type, import_export::CopyParams::geo_assign_render_groups, import_export::CopyParams::geo_coords_comp_param, import_export::CopyParams::geo_coords_encoding, import_export::CopyParams::geo_coords_srid, import_export::CopyParams::geo_coords_type, import_export::CopyParams::geo_explode_collections, import_export::CopyParams::geo_layer_name, Catalog_Namespace::SessionInfo::get_currentUser(), Parser::IntLiteral::get_intval(), Parser::StringLiteral::get_stringval(), Catalog_Namespace::SessionInfo::getCatalog(), legacylockmgr::LockMgr< MutexType, KeyType >::getMutex(), lockmgr::TableLockMgrImpl< InsertDataLockMgr >::getWriteLockForTable(), import_export::HAS_HEADER, import_export::CopyParams::has_header, ddl_utils::IMPORT, logger::INFO, AccessPrivileges::INSERT_INTO_TABLE, kENCODING_GEOINT, kENCODING_NONE, kGEOMETRY, import_export::CopyParams::line_delim, DBObject::loadKey(), LOG, import_export::CopyParams::lonlat, import_export::CopyParams::max_reject, import_export::NO_HEADER, import_export::CopyParams::null_str, import_export::CopyParams::plain_text, import_export::POLYGON, import_export::CopyParams::quote, import_export::CopyParams::quoted, run_benchmark_import::res, run_benchmark_import::rows_rejected, import_export::CopyParams::s3_access_key, import_export::CopyParams::s3_endpoint, import_export::CopyParams::s3_region, import_export::CopyParams::s3_secret_key, DBObject::setPrivileges(), TableDBObjectType, import_export::CopyParams::threads, to_string(), Catalog_Namespace::UserMetadata::userName, and ddl_utils::validate_allowed_file_path().

3572  {
3573  boost::regex non_local_file_regex{R"(^\s*(s3|http|https)://.+)",
3574  boost::regex::extended | boost::regex::icase};
3575  if (!boost::regex_match(*file_pattern, non_local_file_regex)) {
3578  }
3579 
3580  size_t rows_completed = 0;
3581  size_t rows_rejected = 0;
3582  size_t total_time = 0;
3583  bool load_truncated = false;
3584 
3585  // Prevent simultaneous import / truncate (see TruncateTableStmt::execute)
3586  const auto execute_read_lock = mapd_shared_lock<mapd_shared_mutex>(
3589 
3590  const TableDescriptor* td{nullptr};
3591  std::unique_ptr<lockmgr::TableSchemaLockContainer<lockmgr::ReadLock>> td_with_lock;
3592  std::unique_ptr<lockmgr::WriteLock> insert_data_lock;
3593 
3594  auto& catalog = session.getCatalog();
3595 
3596  try {
3597  td_with_lock = std::make_unique<lockmgr::TableSchemaLockContainer<lockmgr::ReadLock>>(
3599  catalog, *table));
3600  td = (*td_with_lock)();
3601  insert_data_lock = std::make_unique<lockmgr::WriteLock>(
3603  } catch (const std::runtime_error& e) {
3604  // noop
3605  // TODO(adb): We're really only interested in whether the table exists or not.
3606  // Create a more refined exception.
3607  }
3608 
3609  // if the table already exists, it's locked, so check access privileges
3610  if (td) {
3611  std::vector<DBObject> privObjects;
3612  DBObject dbObject(*table, TableDBObjectType);
3613  dbObject.loadKey(catalog);
3614  dbObject.setPrivileges(AccessPrivileges::INSERT_INTO_TABLE);
3615  privObjects.push_back(dbObject);
3616  if (!SysCatalog::instance().checkPrivileges(session.get_currentUser(), privObjects)) {
3617  throw std::runtime_error("Violation of access privileges: user " +
3618  session.get_currentUser().userName +
3619  " has no insert privileges for table " + *table + ".");
3620  }
3621  }
3622 
3623  // since we'll have not only posix file names but also s3/hdfs/... url
3624  // we do not expand wildcard or check file existence here.
3625  // from here on, file_path contains something which may be a url
3626  // or a wildcard of file names;
3627  std::string file_path = *file_pattern;
3628  import_export::CopyParams copy_params;
3629  if (!options.empty()) {
3630  for (auto& p : options) {
3631  if (boost::iequals(*p->get_name(), "max_reject")) {
3632  const IntLiteral* int_literal = dynamic_cast<const IntLiteral*>(p->get_value());
3633  if (int_literal == nullptr) {
3634  throw std::runtime_error("max_reject option must be an integer.");
3635  }
3636  copy_params.max_reject = int_literal->get_intval();
3637  } else if (boost::iequals(*p->get_name(), "buffer_size")) {
3638  const IntLiteral* int_literal = dynamic_cast<const IntLiteral*>(p->get_value());
3639  if (int_literal == nullptr) {
3640  throw std::runtime_error("buffer_size option must be an integer.");
3641  }
3642  copy_params.buffer_size = std::max<size_t>(1 << 20, int_literal->get_intval());
3643  } else if (boost::iequals(*p->get_name(), "threads")) {
3644  const IntLiteral* int_literal = dynamic_cast<const IntLiteral*>(p->get_value());
3645  if (int_literal == nullptr) {
3646  throw std::runtime_error("Threads option must be an integer.");
3647  }
3648  copy_params.threads = int_literal->get_intval();
3649  } else if (boost::iequals(*p->get_name(), "delimiter")) {
3650  const StringLiteral* str_literal =
3651  dynamic_cast<const StringLiteral*>(p->get_value());
3652  if (str_literal == nullptr) {
3653  throw std::runtime_error("Delimiter option must be a string.");
3654  } else if (str_literal->get_stringval()->length() != 1) {
3655  throw std::runtime_error("Delimiter must be a single character string.");
3656  }
3657  copy_params.delimiter = (*str_literal->get_stringval())[0];
3658  } else if (boost::iequals(*p->get_name(), "nulls")) {
3659  const StringLiteral* str_literal =
3660  dynamic_cast<const StringLiteral*>(p->get_value());
3661  if (str_literal == nullptr) {
3662  throw std::runtime_error("Nulls option must be a string.");
3663  }
3664  copy_params.null_str = *str_literal->get_stringval();
3665  } else if (boost::iequals(*p->get_name(), "header")) {
3666  const StringLiteral* str_literal =
3667  dynamic_cast<const StringLiteral*>(p->get_value());
3668  if (str_literal == nullptr) {
3669  throw std::runtime_error("Header option must be a boolean.");
3670  }
3671  copy_params.has_header = bool_from_string_literal(str_literal)
3674 #ifdef ENABLE_IMPORT_PARQUET
3675  } else if (boost::iequals(*p->get_name(), "parquet")) {
3676  const StringLiteral* str_literal =
3677  dynamic_cast<const StringLiteral*>(p->get_value());
3678  if (str_literal == nullptr) {
3679  throw std::runtime_error("Parquet option must be a boolean.");
3680  }
3681  if (bool_from_string_literal(str_literal)) {
3682  // not sure a parquet "table" type is proper, but to make code
3683  // look consistent in some places, let's set "table" type too
3684  copy_params.file_type = import_export::FileType::PARQUET;
3685  }
3686 #endif // ENABLE_IMPORT_PARQUET
3687  } else if (boost::iequals(*p->get_name(), "s3_access_key")) {
3688  const StringLiteral* str_literal =
3689  dynamic_cast<const StringLiteral*>(p->get_value());
3690  if (str_literal == nullptr) {
3691  throw std::runtime_error("Option s3_access_key must be a string.");
3692  }
3693  copy_params.s3_access_key = *str_literal->get_stringval();
3694  } else if (boost::iequals(*p->get_name(), "s3_secret_key")) {
3695  const StringLiteral* str_literal =
3696  dynamic_cast<const StringLiteral*>(p->get_value());
3697  if (str_literal == nullptr) {
3698  throw std::runtime_error("Option s3_secret_key must be a string.");
3699  }
3700  copy_params.s3_secret_key = *str_literal->get_stringval();
3701  } else if (boost::iequals(*p->get_name(), "s3_region")) {
3702  const StringLiteral* str_literal =
3703  dynamic_cast<const StringLiteral*>(p->get_value());
3704  if (str_literal == nullptr) {
3705  throw std::runtime_error("Option s3_region must be a string.");
3706  }
3707  copy_params.s3_region = *str_literal->get_stringval();
3708  } else if (boost::iequals(*p->get_name(), "s3_endpoint")) {
3709  const StringLiteral* str_literal =
3710  dynamic_cast<const StringLiteral*>(p->get_value());
3711  if (str_literal == nullptr) {
3712  throw std::runtime_error("Option s3_endpoint must be a string.");
3713  }
3714  copy_params.s3_endpoint = *str_literal->get_stringval();
3715  } else if (boost::iequals(*p->get_name(), "quote")) {
3716  const StringLiteral* str_literal =
3717  dynamic_cast<const StringLiteral*>(p->get_value());
3718  if (str_literal == nullptr) {
3719  throw std::runtime_error("Quote option must be a string.");
3720  } else if (str_literal->get_stringval()->length() != 1) {
3721  throw std::runtime_error("Quote must be a single character string.");
3722  }
3723  copy_params.quote = (*str_literal->get_stringval())[0];
3724  } else if (boost::iequals(*p->get_name(), "escape")) {
3725  const StringLiteral* str_literal =
3726  dynamic_cast<const StringLiteral*>(p->get_value());
3727  if (str_literal == nullptr) {
3728  throw std::runtime_error("Escape option must be a string.");
3729  } else if (str_literal->get_stringval()->length() != 1) {
3730  throw std::runtime_error("Escape must be a single character string.");
3731  }
3732  copy_params.escape = (*str_literal->get_stringval())[0];
3733  } else if (boost::iequals(*p->get_name(), "line_delimiter")) {
3734  const StringLiteral* str_literal =
3735  dynamic_cast<const StringLiteral*>(p->get_value());
3736  if (str_literal == nullptr) {
3737  throw std::runtime_error("Line_delimiter option must be a string.");
3738  } else if (str_literal->get_stringval()->length() != 1) {
3739  throw std::runtime_error("Line_delimiter must be a single character string.");
3740  }
3741  copy_params.line_delim = (*str_literal->get_stringval())[0];
3742  } else if (boost::iequals(*p->get_name(), "quoted")) {
3743  const StringLiteral* str_literal =
3744  dynamic_cast<const StringLiteral*>(p->get_value());
3745  if (str_literal == nullptr) {
3746  throw std::runtime_error("Quoted option must be a boolean.");
3747  }
3748  copy_params.quoted = bool_from_string_literal(str_literal);
3749  } else if (boost::iequals(*p->get_name(), "plain_text")) {
3750  const StringLiteral* str_literal =
3751  dynamic_cast<const StringLiteral*>(p->get_value());
3752  if (str_literal == nullptr) {
3753  throw std::runtime_error("plain_text option must be a boolean.");
3754  }
3755  copy_params.plain_text = bool_from_string_literal(str_literal);
3756  } else if (boost::iequals(*p->get_name(), "array_marker")) {
3757  const StringLiteral* str_literal =
3758  dynamic_cast<const StringLiteral*>(p->get_value());
3759  if (str_literal == nullptr) {
3760  throw std::runtime_error("Array Marker option must be a string.");
3761  } else if (str_literal->get_stringval()->length() != 2) {
3762  throw std::runtime_error(
3763  "Array Marker option must be exactly two characters. Default is {}.");
3764  }
3765  copy_params.array_begin = (*str_literal->get_stringval())[0];
3766  copy_params.array_end = (*str_literal->get_stringval())[1];
3767  } else if (boost::iequals(*p->get_name(), "array_delimiter")) {
3768  const StringLiteral* str_literal =
3769  dynamic_cast<const StringLiteral*>(p->get_value());
3770  if (str_literal == nullptr) {
3771  throw std::runtime_error("Array Delimiter option must be a string.");
3772  } else if (str_literal->get_stringval()->length() != 1) {
3773  throw std::runtime_error("Array Delimiter must be a single character string.");
3774  }
3775  copy_params.array_delim = (*str_literal->get_stringval())[0];
3776  } else if (boost::iequals(*p->get_name(), "lonlat")) {
3777  const StringLiteral* str_literal =
3778  dynamic_cast<const StringLiteral*>(p->get_value());
3779  if (str_literal == nullptr) {
3780  throw std::runtime_error("Lonlat option must be a boolean.");
3781  }
3782  copy_params.lonlat = bool_from_string_literal(str_literal);
3783  } else if (boost::iequals(*p->get_name(), "geo")) {
3784  const StringLiteral* str_literal =
3785  dynamic_cast<const StringLiteral*>(p->get_value());
3786  if (str_literal == nullptr) {
3787  throw std::runtime_error("Geo option must be a boolean.");
3788  }
3789  copy_params.file_type = bool_from_string_literal(str_literal)
3792  } else if (boost::iequals(*p->get_name(), "geo_coords_type")) {
3793  const StringLiteral* str_literal =
3794  dynamic_cast<const StringLiteral*>(p->get_value());
3795  if (str_literal == nullptr) {
3796  throw std::runtime_error("'geo_coords_type' option must be a string");
3797  }
3798  const std::string* s = str_literal->get_stringval();
3799  if (boost::iequals(*s, "geography")) {
3800  throw std::runtime_error(
3801  "GEOGRAPHY coords type not yet supported. Please use GEOMETRY.");
3802  // copy_params.geo_coords_type = kGEOGRAPHY;
3803  } else if (boost::iequals(*s, "geometry")) {
3804  copy_params.geo_coords_type = kGEOMETRY;
3805  } else {
3806  throw std::runtime_error(
3807  "Invalid string for 'geo_coords_type' option (must be 'GEOGRAPHY' or "
3808  "'GEOMETRY'): " +
3809  *s);
3810  }
3811  } else if (boost::iequals(*p->get_name(), "geo_coords_encoding")) {
3812  const StringLiteral* str_literal =
3813  dynamic_cast<const StringLiteral*>(p->get_value());
3814  if (str_literal == nullptr) {
3815  throw std::runtime_error("'geo_coords_encoding' option must be a string");
3816  }
3817  const std::string* s = str_literal->get_stringval();
3818  if (boost::iequals(*s, "none")) {
3819  copy_params.geo_coords_encoding = kENCODING_NONE;
3820  copy_params.geo_coords_comp_param = 0;
3821  } else if (boost::iequals(*s, "compressed(32)")) {
3822  copy_params.geo_coords_encoding = kENCODING_GEOINT;
3823  copy_params.geo_coords_comp_param = 32;
3824  } else {
3825  throw std::runtime_error(
3826  "Invalid string for 'geo_coords_encoding' option (must be 'NONE' or "
3827  "'COMPRESSED(32)'): " +
3828  *s);
3829  }
3830  } else if (boost::iequals(*p->get_name(), "geo_coords_srid")) {
3831  const IntLiteral* int_literal = dynamic_cast<const IntLiteral*>(p->get_value());
3832  if (int_literal == nullptr) {
3833  throw std::runtime_error("'geo_coords_srid' option must be an integer");
3834  }
3835  const int srid = int_literal->get_intval();
3836  if (srid == 4326 || srid == 3857 || srid == 900913) {
3837  copy_params.geo_coords_srid = srid;
3838  } else {
3839  throw std::runtime_error(
3840  "Invalid value for 'geo_coords_srid' option (must be 4326, 3857, or "
3841  "900913): " +
3842  std::to_string(srid));
3843  }
3844  } else if (boost::iequals(*p->get_name(), "geo_layer_name")) {
3845  const StringLiteral* str_literal =
3846  dynamic_cast<const StringLiteral*>(p->get_value());
3847  if (str_literal == nullptr) {
3848  throw std::runtime_error("'geo_layer_name' option must be a string");
3849  }
3850  const std::string* layer_name = str_literal->get_stringval();
3851  if (layer_name) {
3852  copy_params.geo_layer_name = *layer_name;
3853  } else {
3854  throw std::runtime_error("Invalid value for 'geo_layer_name' option");
3855  }
3856  } else if (boost::iequals(*p->get_name(), "partitions")) {
3857  if (copy_params.file_type == import_export::FileType::POLYGON) {
3858  const auto partitions =
3859  static_cast<const StringLiteral*>(p->get_value())->get_stringval();
3860  CHECK(partitions);
3861  const auto partitions_uc = boost::to_upper_copy<std::string>(*partitions);
3862  if (partitions_uc != "REPLICATED") {
3863  throw std::runtime_error("PARTITIONS must be REPLICATED for geo COPY");
3864  }
3865  _geo_copy_from_partitions = partitions_uc;
3866  } else {
3867  throw std::runtime_error("PARTITIONS option not supported for non-geo COPY: " +
3868  *p->get_name());
3869  }
3870  } else if (boost::iequals(*p->get_name(), "geo_assign_render_groups")) {
3871  const StringLiteral* str_literal =
3872  dynamic_cast<const StringLiteral*>(p->get_value());
3873  if (str_literal == nullptr) {
3874  throw std::runtime_error("geo_assign_render_groups option must be a boolean.");
3875  }
3876  copy_params.geo_assign_render_groups = bool_from_string_literal(str_literal);
3877  } else if (boost::iequals(*p->get_name(), "geo_explode_collections")) {
3878  const StringLiteral* str_literal =
3879  dynamic_cast<const StringLiteral*>(p->get_value());
3880  if (str_literal == nullptr) {
3881  throw std::runtime_error("geo_explode_collections option must be a boolean.");
3882  }
3883  copy_params.geo_explode_collections = bool_from_string_literal(str_literal);
3884  } else {
3885  throw std::runtime_error("Invalid option for COPY: " + *p->get_name());
3886  }
3887  }
3888  }
3889 
3890  std::string tr;
3891  if (copy_params.file_type == import_export::FileType::POLYGON) {
3892  // geo import
3893  // we do nothing here, except stash the parameters so we can
3894  // do the import when we unwind to the top of the handler
3895  _geo_copy_from_file_name = file_path;
3896  _geo_copy_from_copy_params = copy_params;
3897  _was_geo_copy_from = true;
3898 
3899  // the result string
3900  // @TODO simon.eves put something more useful in here
3901  // except we really can't because we haven't done the import yet!
3902  if (td) {
3903  tr = std::string("Appending geo to table '") + *table + std::string("'...");
3904  } else {
3905  tr = std::string("Creating table '") + *table +
3906  std::string("' and importing geo...");
3907  }
3908  } else {
3909  if (td) {
3910  CHECK(td_with_lock);
3911 
3912  // regular import
3913  auto importer = importer_factory(catalog, td, file_path, copy_params);
3914  auto ms = measure<>::execution([&]() {
3915  auto res = importer->import();
3916  rows_completed += res.rows_completed;
3917  rows_rejected += res.rows_rejected;
3918  load_truncated = res.load_truncated;
3919  });
3920  total_time += ms;
3921 
3922  // results
3923  if (load_truncated || rows_rejected > copy_params.max_reject) {
3924  LOG(ERROR) << "COPY exited early due to reject records count during multi file "
3925  "processing ";
3926  // if we have crossed the truncated load threshold
3927  load_truncated = true;
3928  success = false;
3929  }
3930  if (!load_truncated) {
3931  tr = std::string("Loaded: " + std::to_string(rows_completed) +
3932  " recs, Rejected: " + std::to_string(rows_rejected) +
3933  " recs in " + std::to_string((double)total_time / 1000.0) +
3934  " secs");
3935  } else {
3936  tr = std::string("Loader truncated due to reject count. Processed : " +
3937  std::to_string(rows_completed) + " recs, Rejected: " +
3938  std::to_string(rows_rejected) + " recs in " +
3939  std::to_string((double)total_time / 1000.0) + " secs");
3940  }
3941  } else {
3942  throw std::runtime_error("Table '" + *table + "' must exist before COPY FROM");
3943  }
3944  }
3945 
3946  return_message.reset(new std::string(tr));
3947  LOG(INFO) << tr;
3948 }
import_export::CopyParams _geo_copy_from_copy_params
Definition: ParserNode.h:1476
std::string s3_secret_key
Definition: CopyParams.h:63
static TimeT::rep execution(F func, Args &&...args)
Definition: sample.cpp:29
std::list< std::unique_ptr< NameValueAssign > > options
Definition: ParserNode.h:1472
#define LOG(tag)
Definition: Logger.h:188
std::unique_ptr< std::string > return_message
Definition: ParserNode.h:1446
static WriteLock getWriteLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
Definition: LockMgrImpl.h:155
static const AccessPrivileges INSERT_INTO_TABLE
Definition: DBObject.h:162
std::unique_ptr< std::string > table
Definition: ParserNode.h:1469
void validate_allowed_file_path(const std::string &file_path, const DataTransferType data_transfer_type)
Definition: DdlUtils.cpp:611
bool bool_from_string_literal(const Parser::StringLiteral *str_literal)
Definition: ParserNode.cpp:909
std::string to_string(char const *&&v)
ImportHeaderRow has_header
Definition: CopyParams.h:48
CHECK(cgen_state)
std::string _geo_copy_from_partitions
Definition: ParserNode.h:1477
std::string geo_layer_name
Definition: CopyParams.h:78
Catalog & getCatalog() const
Definition: SessionInfo.h:65
static std::shared_ptr< MutexType > getMutex(const LockType lockType, const KeyType &key)
Definition: LegacyLockMgr.h:51
std::unique_ptr< std::string > file_pattern
Definition: ParserNode.h:1470
specifies the content in-memory of a row in the table metadata table
std::string _geo_copy_from_file_name
Definition: ParserNode.h:1475
std::string s3_access_key
Definition: CopyParams.h:62
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:68
EncodingType geo_coords_encoding
Definition: CopyParams.h:73

+ Here is the call graph for this function:

void Parser::CopyTableStmt::get_geo_copy_from_payload ( std::string &  geo_copy_from_table,
std::string &  geo_copy_from_file_name,
import_export::CopyParams geo_copy_from_copy_params,
std::string &  geo_copy_from_partitions 
)
inline

Definition at line 1457 of file ParserNode.h.

References _geo_copy_from_copy_params, _geo_copy_from_file_name, _geo_copy_from_partitions, _was_geo_copy_from, and table.

1460  {
1461  geo_copy_from_table = *table;
1462  geo_copy_from_file_name = _geo_copy_from_file_name;
1463  geo_copy_from_copy_params = _geo_copy_from_copy_params;
1464  geo_copy_from_partitions = _geo_copy_from_partitions;
1465  _was_geo_copy_from = false;
1466  }
import_export::CopyParams _geo_copy_from_copy_params
Definition: ParserNode.h:1476
std::unique_ptr< std::string > table
Definition: ParserNode.h:1469
std::string _geo_copy_from_partitions
Definition: ParserNode.h:1477
std::string _geo_copy_from_file_name
Definition: ParserNode.h:1475
bool Parser::CopyTableStmt::get_success ( ) const
inline

Definition at line 1453 of file ParserNode.h.

References success.

1453 { return success; }
std::string& Parser::CopyTableStmt::get_table ( ) const
inline

Definition at line 1448 of file ParserNode.h.

References CHECK(), and table.

1448  {
1449  CHECK(table);
1450  return *table;
1451  }
std::unique_ptr< std::string > table
Definition: ParserNode.h:1469
CHECK(cgen_state)

+ Here is the call graph for this function:

bool Parser::CopyTableStmt::was_geo_copy_from ( ) const
inline

Definition at line 1455 of file ParserNode.h.

References _was_geo_copy_from.

1455 { return _was_geo_copy_from; }

Member Data Documentation

import_export::CopyParams Parser::CopyTableStmt::_geo_copy_from_copy_params
private

Definition at line 1476 of file ParserNode.h.

Referenced by get_geo_copy_from_payload().

std::string Parser::CopyTableStmt::_geo_copy_from_file_name
private

Definition at line 1475 of file ParserNode.h.

Referenced by get_geo_copy_from_payload().

std::string Parser::CopyTableStmt::_geo_copy_from_partitions
private

Definition at line 1477 of file ParserNode.h.

Referenced by get_geo_copy_from_payload().

bool Parser::CopyTableStmt::_was_geo_copy_from = false
private

Definition at line 1474 of file ParserNode.h.

Referenced by get_geo_copy_from_payload(), and was_geo_copy_from().

std::unique_ptr<std::string> Parser::CopyTableStmt::file_pattern
private

Definition at line 1470 of file ParserNode.h.

std::list<std::unique_ptr<NameValueAssign> > Parser::CopyTableStmt::options
private

Definition at line 1472 of file ParserNode.h.

Referenced by CopyTableStmt().

std::unique_ptr<std::string> Parser::CopyTableStmt::return_message

Definition at line 1446 of file ParserNode.h.

bool Parser::CopyTableStmt::success
private

Definition at line 1471 of file ParserNode.h.

Referenced by get_success().

std::unique_ptr<std::string> Parser::CopyTableStmt::table
private

Definition at line 1469 of file ParserNode.h.

Referenced by get_geo_copy_from_payload(), and get_table().


The documentation for this class was generated from the following files: