GPUdb C++ API  Version 7.2.2.4
gpudb::InsertRecordsFromFilesRequest Struct Reference

A set of parameters for GPUdb::insertRecordsFromFiles. More...

#include <gpudb/protocol/insert_records_from_files.h>

Public Member Functions

 InsertRecordsFromFilesRequest ()
 Constructs an InsertRecordsFromFilesRequest object with default parameters. More...
 
 InsertRecordsFromFilesRequest (const std::string &tableName_, const std::vector< std::string > &filepaths_, const std::map< std::string, std::map< std::string, std::string > > &modifyColumns_, const std::map< std::string, std::string > &createTableOptions_, const std::map< std::string, std::string > &options_)
 Constructs an InsertRecordsFromFilesRequest object with the specified parameters. More...
 

Public Attributes

std::string tableName
 Name of the table into which the data will be inserted, in [ schema_name. ]table_name format, using standard name resolution rules. More...
 
std::vector< std::string > filepaths
 A list of file paths from which data will be sourced;. More...
 
std::map< std::string, std::map< std::string, std::string > > modifyColumns
 Not implemented yet. More...
 
std::map< std::string, std::string > createTableOptions
 Options from GPUdb::createTable, allowing the structure of the table to be defined independently of the data source, when creating the target table. More...
 
std::map< std::string, std::string > options
 Optional parameters. More...
 

Detailed Description

A set of parameters for GPUdb::insertRecordsFromFiles.

Reads from one or more files and inserts the data into a new or existing table. The source data can be located either in KiFS; on the cluster, accessible to the database; or remotely, accessible via a pre-defined external data source.

For delimited text files, there are two loading schemes: positional and name-based. The name-based loading scheme is enabled when the file has a header present and text_has_header is set to true. In this scheme, the source file(s) field names must match the target table's column names exactly; however, the source file can have more fields than the target table has columns. If error_handling is set to permissive, the source file can have fewer fields than the target table has columns. If the name-based loading scheme is being used, names matching the file header's names may be provided to columns_to_load instead of numbers, but ranges are not supported.

Note: Due to data being loaded in parallel, there is no insertion order guaranteed. For tables with primary keys, in the case of a primary key collision, this means it is indeterminate which record will be inserted first and remain, while the rest of the colliding key records are discarded.

Returns once all files are processed.

Definition at line 47 of file insert_records_from_files.h.

Constructor & Destructor Documentation

◆ InsertRecordsFromFilesRequest() [1/2]

gpudb::InsertRecordsFromFilesRequest::InsertRecordsFromFilesRequest ( )
inline

Constructs an InsertRecordsFromFilesRequest object with default parameters.

Definition at line 53 of file insert_records_from_files.h.

◆ InsertRecordsFromFilesRequest() [2/2]

gpudb::InsertRecordsFromFilesRequest::InsertRecordsFromFilesRequest ( const std::string &  tableName_,
const std::vector< std::string > &  filepaths_,
const std::map< std::string, std::map< std::string, std::string > > &  modifyColumns_,
const std::map< std::string, std::string > &  createTableOptions_,
const std::map< std::string, std::string > &  options_ 
)
inline

Constructs an InsertRecordsFromFilesRequest object with the specified parameters.

Parameters
[in]tableName_Name of the table into which the data will be inserted, in [schema_name.]table_name format, using standard name resolution rules. If the table does not exist, the table will be created using either an existing type_id or the type inferred from the file, and the new table name will have to meet standard table naming criteria.
[in]filepaths_A list of file paths from which data will be sourced; For paths in KiFS, use the uri prefix of kifs:// followed by the path to a file or directory. File matching by prefix is supported, e.g. kifs://dir/file would match dir/file_1 and dir/file_2. When prefix matching is used, the path must start with a full, valid KiFS directory name. If an external data source is specified in datasource_name, these file paths must resolve to accessible files at that data source location. Prefix matching is supported. If the data source is hdfs, prefixes must be aligned with directories, i.e. partial file names will not match. If no data source is specified, the files are assumed to be local to the database and must all be accessible to the gpudb user, residing on the path (or relative to the path) specified by the external files directory in the Kinetica configuration file. Wildcards (*) can be used to specify a group of files. Prefix matching is supported, the prefixes must be aligned with directories. If the first path ends in .tsv, the text delimiter will be defaulted to a tab character. If the first path ends in .psv, the text delimiter will be defaulted to a pipe character (|).
[in]modifyColumns_Not implemented yet. The default value is an empty map.
[in]createTableOptions_Options from GPUdb::createTable, allowing the structure of the table to be defined independently of the data source, when creating the target table. The default value is an empty map.
[in]options_Optional parameters. The default value is an empty map.

Definition at line 1249 of file insert_records_from_files.h.

Member Data Documentation

◆ createTableOptions

std::map<std::string, std::string> gpudb::InsertRecordsFromFilesRequest::createTableOptions

Options from GPUdb::createTable, allowing the structure of the table to be defined independently of the data source, when creating the target table.

The default value is an empty map.

Definition at line 1486 of file insert_records_from_files.h.

◆ filepaths

std::vector<std::string> gpudb::InsertRecordsFromFilesRequest::filepaths

A list of file paths from which data will be sourced;.

For paths in KiFS, use the uri prefix of kifs:// followed by the path to a file or directory. File matching by prefix is supported, e.g.\ kifs://dir/file would match dir/file_1 and dir/file_2. When prefix matching is used, the path must start with a full, valid KiFS directory name.

If an external data source is specified in datasource_name, these file paths must resolve to accessible files at that data source location. Prefix matching is supported. If the data source is hdfs, prefixes must be aligned with directories, i.e. partial file names will not match.

If no data source is specified, the files are assumed to be local to the database and must all be accessible to the gpudb user, residing on the path (or relative to the path) specified by the external files directory in the Kinetica configuration file. Wildcards (*) can be used to specify a group of files. Prefix matching is supported, the prefixes must be aligned with directories.

If the first path ends in .tsv, the text delimiter will be defaulted to a tab character. If the first path ends in .psv, the text delimiter will be defaulted to a pipe character (|).

Definition at line 1301 of file insert_records_from_files.h.

◆ modifyColumns

std::map<std::string, std::map<std::string, std::string> > gpudb::InsertRecordsFromFilesRequest::modifyColumns

Not implemented yet.

The default value is an empty map.

Definition at line 1306 of file insert_records_from_files.h.

◆ options

std::map<std::string, std::string> gpudb::InsertRecordsFromFilesRequest::options

Optional parameters.

The default value is an empty map.

Definition at line 2104 of file insert_records_from_files.h.

◆ tableName

std::string gpudb::InsertRecordsFromFilesRequest::tableName

Name of the table into which the data will be inserted, in [ schema_name. ]table_name format, using standard name resolution rules.

If the table does not exist, the table will be created using either an existing type_id or the type inferred from the file, and the new table name will have to meet standard table naming criteria.

Definition at line 1269 of file insert_records_from_files.h.


The documentation for this struct was generated from the following file: