The client uses the GPSS Open
service to specify and prepare a VMware Tanzu Greenplum table for writing. The Close
service closes, or ends, a write operation on the table.
The Open
service definition follows:
The GPSS client can insert or merge data into or update the data in a Tanzu Greenplum table. The client specifies the mode of the write operation via a mode-specific Option
that it provides to the OpenRequest
message. Supported write operation modes include:
- Insert - add data to the table, optionally truncating before writing
- Update - update table data, specifying the join column and an optional update condition
- Merge - insert table data, specifying the join column and an optional insert condition
Relevant messages for the Open
service include:
After it completes loading data or encounters an error from GPSS or the source, the GPSS client invokes the Close
service on the table. Close
returns the success and error row counts and any error strings in the TransferStats
message.
The Close
service definition and relevant messages follow:
Use MaxErrorRows
to identify the form and amount of error information that GPSS returns:
MaxErrorRows Value | Description |
---|---|
-1 | Returns an ErrorCount and all ErrorRows (error messages). |
0 | Returns only an ErrorCount ; no ErrorRows . The default. |
n > 0 | Returns an ErrorCount and a maximum of n ErrorRows . |
If the GPSS client encounters an unrecoverable error that affects the load operation to Tanzu Greenplum, it may choose to cancel writing the current batch of data. When the CloseRequest
message is instantiated with .setAbort(true)
, GPSS cancels and rolls back the pending write transaction. This rolls back all writes since the Open
.
Sample Code
Suppose you create a Tanzu Greenplum table with the following command:
Sample Java code to prepare to open the loaninfo
table for insert, and then close the table follows:
Content feedback and comments