Note
This documentation is for a prior release of Kinetica. For the latest documentation, click here.
URL: http://<db.host>:<db.port>/merge/records
Create a new empty result table (specified by input parameter table_name), and insert all records from source tables (specified by input parameter source_table_names) based on the field mapping information (specified by input parameter field_maps).
For merge records details and examples, see Merge Records. For limitations, see Merge Records Limitations and Cautions.
The field map (specified by input parameter field_maps) holds the user-specified maps of target table column names to source table columns. The array of input parameter field_maps must match one-to-one with the input parameter source_table_names, e.g., there's a map present in input parameter field_maps for each table listed in input parameter source_table_names.
Input Parameter Description
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
table_name | string | The name of the new result table for the records to be merged into, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. Must NOT be an existing table. | ||||||||||||||||
source_table_names | array of strings | The list of names of source tables to get the records from, each in [schema_name.]table_name format, using standard name resolution rules. Must be existing table names. | ||||||||||||||||
field_maps | array of maps of string to strings | Contains a list of source/target column mappings, one mapping for each source table listed in input parameter source_table_names being merged into the target table specified by input parameter table_name. Each mapping contains the target column names (as keys) that the data in the mapped source columns or column expressions (as values) will be merged into. All of the source columns being merged into a given target column must match in type, as that type will determine the type of the new target column. | ||||||||||||||||
options | map of string to strings | Optional parameters. The default value is an empty map ( {} ).
|
Output Parameter Description
The GPUdb 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:
Name | Type | Description | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | String | 'OK' or 'ERROR' | |||||||||||||
message | String | Empty if success or an error message | |||||||||||||
data_type | String | 'merge_records_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 /merge/records endpoint:
Empty string in case of an error. |