Execute COPY Command
Operation name
Execute COPY Command
Function overview
Executes COPY command to Amazon Redshift.
For details on COPY command specifications of this component, refer to the following link page:
-
"Amazon Redshift document - Database Developer Guide - COPY" - (http://docs.aws.amazon.com/en_us/redshift/latest/dg/r_COPY.html)
Data model
The data model of this component is table model type.
Properties
For details on use of variables, refer to Variables.
Basic settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Name |
Required |
Not available |
Enter a name that is used on the script canvas. |
|
Required settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
connection destination |
Required |
Not available |
Select a connection resource.
|
|
COPY command |
Required |
Available |
Enter the COPY sentence that is issued to Amazon Redshift. |
Note
COPY command needs to start from "COPY".
|
COMMIT when command is successfully terminated. |
Optional |
Not available |
Select whether to perform COMMIT if command successfully finishes.
|
|
Data processing method
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Data processing method |
Required |
Not available |
Select a data processing method.
|
|
Comment
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Comment |
Optional |
Not available |
You can write a short description of this connector. |
|
Input schema
None.
Output schema
<?xml version="1.0"?> <table> <row> <column>STL_LOAD_ERRORS_userid</column> <column>STL_LOAD_ERRORS_slice</column> <column>STL_LOAD_ERRORS_tbl</column> <column>STL_LOAD_ERRORS_starttime</column> <column>STL_LOAD_ERRORS_session</column> <column>STL_LOAD_ERRORS_query</column> <column>STL_LOAD_ERRORS_filename</column> <column>STL_LOAD_ERRORS_line_number</column> <column>STL_LOAD_ERRORS_colname</column> <column>STL_LOAD_ERRORS_type</column> <column>STL_LOAD_ERRORS_col_length</column> <column>STL_LOAD_ERRORS_position</column> <column>STL_LOAD_ERRORS_raw_line</column> <column>STL_LOAD_ERRORS_raw_field_value</column> <column>STL_LOAD_ERRORS_err_code</column> <column>STL_LOAD_ERRORS_err_reason</column> </row> <row> : </row> </table>
Column name |
Description |
Remarks |
|
---|---|---|---|
row |
- |
Outputs a row for each record. |
|
STL_LOAD_ERRORS_userid |
Outputs the user ID that created entry. |
|
|
STL_LOAD_ERRORS_slice |
Outputs the slice where the error occurred. |
|
|
STL_LOAD_ERRORS_tbl |
Outputs the table ID. |
|
|
STL_LOAD_ERRORS_starttime |
Outputs the start time of loading in UTC. |
|
|
STL_LOAD_ERRORS_session |
Outputs the session ID of load executing session. |
|
|
STL_LOAD_ERRORS_query |
Outputs the query ID. |
|
|
STL_LOAD_ERRORS_filename |
Outputs the complete path to the load input file. |
|
|
STL_LOAD_ERRORS_line_number |
Outputs the row number where error occurred in the load file. |
|
|
STL_LOAD_ERRORS_colname |
Outputs the field where error occurred. |
|
|
STL_LOAD_ERRORS_type |
Outputs the data type of field. |
|
|
STL_LOAD_ERRORS_col_length |
If defined, outputs the column length. |
|
|
STL_LOAD_ERRORS_position |
Outputs the position of error in the field. |
|
|
STL_LOAD_ERRORS_raw_line |
Outputs the raw loading data including errors. |
|
|
STL_LOAD_ERRORS_raw_field_value |
Outputs the pre-parsing value of the "colname" field that raises the parsing error. |
|
|
STL_LOAD_ERRORS_err_code |
Outputs error code. |
|
|
STL_LOAD_ERRORS_err_reason |
Outputs error description. |
|
Loading schema in Mapper
The schema is loaded automatically.
For details, refer to Edit Schema.
Mass data processing
Mass data processing is supported.
Parallel Stream Processing
PSP isn't supported.
Available component variables
Component variable name |
Description |
Remarks |
---|---|---|
copy_count |
The number of data records for which COPY succeeded is stored. |
|
copy_query_id |
Query ID is stored. |
|
has_error_data |
Existence of error data is stored. |
|
error_data_count |
The number of error data records is stored. |
|
command_message |
Result message of COPY command is stored. |
|
message_category |
When an error occurs, the category of the message code corresponding to the error is stored. |
|
message_code |
When an error occurs, the code of the message code corresponding to the error is stored. |
|
message_level |
When an error occurs, the severity of the message code corresponding to the error is stored. |
|
error_type |
When an error occurs, the error type is stored. |
|
error_message |
When an error occurs, the error message is stored. |
|
error_trace |
When an error occurs, the trace information for the error is stored. |
|
Error data
If load error is output to STL table "STL_LOAD_ERRORS" of Amazon Redshift after executing COPY command, error data can be output.
-
The search key of STL table "STL_LOAD_ERRORS" is the query ID.
= Remarks =For details on STL table "STL_LOAD_ERRORS", refer to the following link page:
-
"Amazon Redshift document - Database Developer Guide - STL_LOAD_ERRORS" - (http://docs.aws.amazon.com/en_us/redshift/latest/dg/r_STL_LOAD_ERRORS.html)
-
-
If you prefer to get additional details of the accurate column and row of data where an error occurred after getting error data, check STL table "STL_LOADERROR_DETAIL" by using query ID as the key.
= Remarks =For details on STL table "STL_LOADERROR_DETAIL", refer to the following link page:
-
"Amazon Redshift document - Database Developer Guide - STL_LOADERROR_DETAIL" - (http://docs.aws.amazon.com/en_us/redshift/latest/dg/r_STL_LOADERROR_DETAIL.html)
-
Message codes, exception messages, and limitations
Connector |
Message code |
Exception message |
Limitations |
---|---|---|---|
None |
Notes
-
To execute COPY command, INSERT privilege is required for Amazon Redshift table.
-
Query ID is updated when executing COPY command. However, if this query ID exceeds the maximum value (2147483647), the next software maintenance of Redshift may fail.
In this case, query ID will be initialized by performing Resize of cluster before it exceeds the maximum value of query ID.