OmniSciDB  dfae7c3b14
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

◆ CopyTableStmt()

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

Definition at line 1430 of file ParserNode.h.

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

◆ execute() [1/2]

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

Implements Parser::DDLStmt.

Definition at line 3545 of file ParserNode.cpp.

Referenced by DBHandler::execute_distributed_copy_statement(), omnisci.cursor.Cursor::executemany(), and QueryRunner::QueryRunner::runImport().

3545  {
3546  auto importer_factory = [](Catalog_Namespace::Catalog& catalog,
3547  const TableDescriptor* td,
3548  const std::string& file_path,
3549  const import_export::CopyParams& copy_params) {
3550  return std::make_unique<import_export::Importer>(catalog, td, file_path, copy_params);
3551  };
3552  return execute(session, importer_factory);
3553 }
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:97
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:

◆ execute() [2/2]

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

Referenced by omnisci.cursor.Cursor::executemany().

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

◆ get_geo_copy_from_payload()

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.

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

◆ get_success()

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

Definition at line 1453 of file ParserNode.h.

1453 { return success; }

◆ get_table()

std::string& Parser::CopyTableStmt::get_table ( ) const
inline

Definition at line 1448 of file ParserNode.h.

References CHECK.

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

◆ was_geo_copy_from()

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

Definition at line 1455 of file ParserNode.h.

1455 { return _was_geo_copy_from; }

Member Data Documentation

◆ _geo_copy_from_copy_params

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

Definition at line 1476 of file ParserNode.h.

◆ _geo_copy_from_file_name

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

Definition at line 1475 of file ParserNode.h.

◆ _geo_copy_from_partitions

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

Definition at line 1477 of file ParserNode.h.

◆ _was_geo_copy_from

bool Parser::CopyTableStmt::_was_geo_copy_from = false
private

Definition at line 1474 of file ParserNode.h.

◆ file_pattern

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

Definition at line 1470 of file ParserNode.h.

◆ options

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

Definition at line 1472 of file ParserNode.h.

◆ return_message

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

Definition at line 1446 of file ParserNode.h.

◆ success

bool Parser::CopyTableStmt::success
private

Definition at line 1471 of file ParserNode.h.

Referenced by omnisci.thrift.ttypes.TQueryResult::read(), omnisci.thrift.OmniSci.connect_result::read(), omnisci.thrift.OmniSci.krb5_connect_result::read(), omnisci.thrift.OmniSci.clone_session_result::read(), omnisci.thrift.OmniSci.get_server_status_result::read(), omnisci.thrift.OmniSci.get_status_result::read(), omnisci.thrift.OmniSci.get_hardware_info_result::read(), omnisci.thrift.OmniSci.get_tables_result::read(), omnisci.thrift.OmniSci.get_physical_tables_result::read(), omnisci.thrift.OmniSci.get_views_result::read(), omnisci.thrift.OmniSci.get_tables_meta_result::read(), omnisci.thrift.OmniSci.get_table_details_result::read(), omnisci.thrift.OmniSci.get_internal_table_details_result::read(), omnisci.thrift.OmniSci.get_users_result::read(), omnisci.thrift.OmniSci.get_databases_result::read(), omnisci.thrift.OmniSci.get_version_result::read(), omnisci.thrift.OmniSci.get_heap_profile_result::read(), omnisci.thrift.OmniSci.get_memory_result::read(), omnisci.thrift.OmniSci.get_table_epoch_result::read(), omnisci.thrift.OmniSci.get_table_epoch_by_name_result::read(), omnisci.thrift.OmniSci.get_session_info_result::read(), omnisci.thrift.OmniSci.sql_execute_result::read(), omnisci.thrift.OmniSci.sql_execute_df_result::read(), omnisci.thrift.OmniSci.sql_execute_gdf_result::read(), omnisci.thrift.OmniSci.sql_validate_result::read(), omnisci.thrift.OmniSci.get_completion_hints_result::read(), omnisci.thrift.OmniSci.render_vega_result::read(), omnisci.thrift.OmniSci.get_result_row_for_pixel_result::read(), omnisci.thrift.OmniSci.get_dashboard_result::read(), omnisci.thrift.OmniSci.get_dashboards_result::read(), omnisci.thrift.OmniSci.create_dashboard_result::read(), omnisci.thrift.OmniSci.get_dashboard_grantees_result::read(), omnisci.thrift.OmniSci.get_link_view_result::read(), omnisci.thrift.OmniSci.create_link_result::read(), omnisci.thrift.OmniSci.detect_column_types_result::read(), omnisci.thrift.OmniSci.import_table_status_result::read(), omnisci.thrift.OmniSci.get_first_geo_file_in_archive_result::read(), omnisci.thrift.OmniSci.get_all_files_in_archive_result::read(), omnisci.thrift.OmniSci.get_layers_in_geo_file_result::read(), omnisci.thrift.OmniSci.query_get_outer_fragment_count_result::read(), omnisci.thrift.OmniSci.check_table_consistency_result::read(), omnisci.thrift.OmniSci.start_query_result::read(), omnisci.thrift.OmniSci.execute_query_step_result::read(), omnisci.thrift.OmniSci.start_render_query_result::read(), omnisci.thrift.OmniSci.execute_next_render_step_result::read(), omnisci.thrift.OmniSci.get_roles_result::read(), omnisci.thrift.OmniSci.get_db_objects_for_grantee_result::read(), omnisci.thrift.OmniSci.get_db_object_privs_result::read(), omnisci.thrift.OmniSci.get_all_roles_for_user_result::read(), omnisci.thrift.OmniSci.has_role_result::read(), omnisci.thrift.OmniSci.has_object_privilege_result::read(), omnisci.thrift.OmniSci.set_license_key_result::read(), omnisci.thrift.OmniSci.get_license_claims_result::read(), omnisci.thrift.OmniSci.get_device_parameters_result::read(), omnisci.thrift.ttypes.TQueryResult::write(), omnisci.thrift.OmniSci.connect_result::write(), omnisci.thrift.OmniSci.krb5_connect_result::write(), omnisci.thrift.OmniSci.clone_session_result::write(), omnisci.thrift.OmniSci.get_server_status_result::write(), omnisci.thrift.OmniSci.get_status_result::write(), omnisci.thrift.OmniSci.get_hardware_info_result::write(), omnisci.thrift.OmniSci.get_tables_result::write(), omnisci.thrift.OmniSci.get_physical_tables_result::write(), omnisci.thrift.OmniSci.get_views_result::write(), omnisci.thrift.OmniSci.get_tables_meta_result::write(), omnisci.thrift.OmniSci.get_table_details_result::write(), omnisci.thrift.OmniSci.get_internal_table_details_result::write(), omnisci.thrift.OmniSci.get_users_result::write(), omnisci.thrift.OmniSci.get_databases_result::write(), omnisci.thrift.OmniSci.get_version_result::write(), omnisci.thrift.OmniSci.get_heap_profile_result::write(), omnisci.thrift.OmniSci.get_memory_result::write(), omnisci.thrift.OmniSci.get_table_epoch_result::write(), omnisci.thrift.OmniSci.get_table_epoch_by_name_result::write(), omnisci.thrift.OmniSci.get_session_info_result::write(), omnisci.thrift.OmniSci.sql_execute_result::write(), omnisci.thrift.OmniSci.sql_execute_df_result::write(), omnisci.thrift.OmniSci.sql_execute_gdf_result::write(), omnisci.thrift.OmniSci.sql_validate_result::write(), omnisci.thrift.OmniSci.get_completion_hints_result::write(), omnisci.thrift.OmniSci.render_vega_result::write(), omnisci.thrift.OmniSci.get_result_row_for_pixel_result::write(), omnisci.thrift.OmniSci.get_dashboard_result::write(), omnisci.thrift.OmniSci.get_dashboards_result::write(), omnisci.thrift.OmniSci.create_dashboard_result::write(), omnisci.thrift.OmniSci.get_dashboard_grantees_result::write(), omnisci.thrift.OmniSci.get_link_view_result::write(), omnisci.thrift.OmniSci.create_link_result::write(), omnisci.thrift.OmniSci.detect_column_types_result::write(), omnisci.thrift.OmniSci.import_table_status_result::write(), omnisci.thrift.OmniSci.get_first_geo_file_in_archive_result::write(), omnisci.thrift.OmniSci.get_all_files_in_archive_result::write(), omnisci.thrift.OmniSci.get_layers_in_geo_file_result::write(), omnisci.thrift.OmniSci.query_get_outer_fragment_count_result::write(), omnisci.thrift.OmniSci.check_table_consistency_result::write(), omnisci.thrift.OmniSci.start_query_result::write(), omnisci.thrift.OmniSci.execute_query_step_result::write(), omnisci.thrift.OmniSci.start_render_query_result::write(), omnisci.thrift.OmniSci.execute_next_render_step_result::write(), omnisci.thrift.OmniSci.get_roles_result::write(), omnisci.thrift.OmniSci.get_db_objects_for_grantee_result::write(), omnisci.thrift.OmniSci.get_db_object_privs_result::write(), omnisci.thrift.OmniSci.get_all_roles_for_user_result::write(), omnisci.thrift.OmniSci.has_role_result::write(), omnisci.thrift.OmniSci.has_object_privilege_result::write(), omnisci.thrift.OmniSci.set_license_key_result::write(), omnisci.thrift.OmniSci.get_license_claims_result::write(), and omnisci.thrift.OmniSci.get_device_parameters_result::write().

◆ table

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

Definition at line 1469 of file ParserNode.h.


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