Skip to main content
URL: http://<db.host>:<db.port>/export/records/tofiles
Export records from a table to files. All tables can be exported, in full or partial (see columns_to_export and columns_to_skip). Additional filtering can be applied when using export table with expression through SQL. Default destination is KIFS, though other storage types (Azure, S3, GCS, and HDFS) are supported through datasink_name; see /create/datasink. Server’s local file system is not supported. Default file format is delimited text. See options for different file types and different options for each file type. Table is saved to a single file if within max file size limits (may vary depending on datasink type). If not, then table is split into multiple files; these may be smaller than the max size limit. All filenames created are returned in the response.

Input Parameter Description

table_name
string
filepath
string
Path to data export target. If input parameter filepath has a file extension, it is read as the name of a file. If input parameter filepath is a directory, then the source table name with a random UUID appended will be used as the name of each exported file, all written to that directory. If filepath is a filename, then all exported files will have a random UUID appended to the given name. In either case, the target directory specified or implied must exist. The names of all exported files are returned in the response.
options
map of string to strings
Optional parameters.The default value is an empty map ( {} ).

Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:
status
String
‘OK’ or ‘ERROR’
message
String
Empty if success or an error message
data_type
String
‘export_records_to_files_response’ or ‘none’ in case of an error
data
String
Empty string
data_str
JSON or String
This embedded JSON represents the result of the /export/records/tofiles endpoint:Empty string in case of an error.