Writable external tables that output data to files can use the Greenplum parallel file server program, gpfdist, or the Greenplum Platform Extension Framework (PXF), Greenplum’s interface to Hadoop.
CREATE WRITABLE EXTERNAL TABLE command to define the external table and specify the location and format of the output files. See Using the Greenplum Parallel File Server (gpfdist) for instructions on setting up gpfdist for use with an external table and Accessing External Data with PXF for instructions on setting up PXF for use with an external table
EXECUTEclause to specify a shell command, script, or application to run on the segment hosts and accept an input stream of data. See Defining a Command-Based Writable External Web Table for more information about using
EXECUTEcommands in a writable external table definition.
You can optionally declare a distribution policy for your writable external tables. By default, writable external tables use a random distribution policy. If the source table you are exporting data from has a hash distribution policy, defining the same distribution key column(s) for the writable external table improves unload performance by eliminating the requirement to move rows over the interconnect. If you unload data from a particular table, you can use the
LIKE clause to copy the column definitions and distribution policy from the source table.
Parent topic: Unloading Data from Greenplum Database