Transforming with INSERT INTO SELECT FROM

This version of the Pivotal Greenplum documentation is no longer actively maintained. Click here to view the most up-to-date version of the Greenplum 4.x documentation.

Transforming with INSERT INTO SELECT FROM

Specify the transformation in the CREATE EXTERNAL TABLE definition's LOCATION clause. For example, the transform is shown in bold in the following command. (Run gpfdist first, using the command gpfdist -c config.yaml).

CREATE READABLE EXTERNAL TABLE prices_readable (LIKE prices)
   LOCATION ('gpfdist://hostname:8080/prices.xml#transform=prices_input')
   FORMAT 'TEXT' (DELIMITER '|')
   LOG ERRORS SEGMENT REJECT LIMIT 10;

In the command above, change hostname to your hostname. prices_input comes from the configuration file.

The following query loads data into the prices table.

INSERT INTO prices SELECT * FROM prices_readable;