Importing Data from Greenplum to GemFire

An import copies all rows from a Pivotal Greenplum® Database (GPDB) table to a Pivotal GemFire® region.

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

The mapping of GPDB 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 GPDB 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 GPDB 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 GPDB 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 GPDB table to be imported is described within a GPDB schema, but that schema is not specified in the GPDB 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.