Create External Tables "Error: Escape in CSV Format Must be a Single Character"
search cancel

Create External Tables "Error: Escape in CSV Format Must be a Single Character"

book

Article ID: 295537

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Symptoms:

Creating an external table for a file with "ESCAPE" set to "OFF" produces the following error:

"Error: Escape in CSV format must be a single character"

For example, using the following syntax reproduces this issue:

CREATE EXTERNAL TABLE test(a character varying(8))
('gpfdist://localhost:8081/data/test.csv')
FORMAT 'CSV' (DELIMITER E'\t' ESCAPE 'OFF');

 

Environment


Cause

ESCAPE 'OFF' is only supported for TEXT format. It is not supported for CSV format.

 

Resolution

Replace the CSV format to TEXT:

CREATE EXTERNAL TABLE test(a character varying(8))
('gpfdist://localhost:8081/data/test.csv')
FORMAT 'TEXT' (DELIMITER E'\t' ESCAPE 'OFF');