An import copies all rows from a VMware Tanzu Greenplum database table to a VMware Tanzu GemFire region.

The import implements an upsert functionality: if a Greenplum Database row imported is already present in a GemFire entry, the entry value will be updated if it has changed. If the Greenplum row does not already exist as a GemFire entry, a new entry is created.

The mapping of Greenplum Database table rows to GemFire region entries is within the region element definition of the GemFire cache.xml file.

An import operation may be invoked using API calls or with the gfsh import command.

Import Using the API

Import region functionality is exposed through the GpdbService class.


ImportConfiguration configuration = ImportConfiguration.builder(region)
ImportResult importResult = GpdbService.importRegion(configuration);

// Get the total number of Greenplum rows imported into the GemFire region.
int importCount =  importResult.getImportedCount();

The OperationEventListener interface provides further flexibility by allowing a set of callbacks to be defined. The callbacks are invoked at various points during an import of a Greenplum Database table.

Import Using gfsh

See the command reference page for details on this use of the gfsh import command.

Requirements and Caveats

  • Multiple regions may import from the same Greenplum Database table concurrently.

  • The import operation requires a definition of the GemFire key for an entry. A missing cache.xml entry for the gpdb:id element or an empty field as <gpdb:id \> will throw an error when an import operation is attempted.

  • An incomplete cache.xml entry for the gpdb:id element, which omits fields that should have been part of a composite key, will not result in an error for an import operation. It will, however, result in leaving the GemFire region in an indeterminate state.

  • If the Greenplum Database table to be imported is described within a Greenplum schema, but that schema is not specified in the Greenplum configuration parameter search_path, the schema name must be specified by a schema attribute within the gpdb:pdx element of the GemFire cache.xml file.

check-circle-line exclamation-circle-line close-line
Scroll to top icon