You specify a custom data format in the FORMAT
clause of CREATE EXTERNAL TABLE
.
FORMAT 'CUSTOM' (formatter=format_function, key1=val1,...keyn=valn)
Where the 'CUSTOM'
keyword indicates that the data has a custom format and formatter
specifies the function to use to format the data, followed by comma-separated parameters to the formatter function.
Greenplum Database provides functions for formatting fixed-width data, but you must author the formatter functions for variable-width data. The steps are as follows.
CREATE FUNCTION
in Greenplum Database.formatter
parameter of CREATE EXTERNAL TABLE
's FORMAT
clause to call the function.Parent topic: Loading and Writing Non-HDFS Custom Data