Question

I am attempting to load data from a *.csv file off my VM of the Greenplum Community edition; however, I am having issues creating the external table.

CREATE EXTERNAL 
    TABLE flightinfo (flightid int, airline_id int, carrier character(2), fl_num int)
    LOCATION ('gpfdist://home/gpadmin/Desktop/flighttable.csv') FORMAT 'CSV';

This keeps giving an error where it is unable to translate the host name...I've tried with localhost and others, but still nothing appears to be working.

Was it helpful?

Solution

External table declarations need the name of the host, the port your gpfdist instance is listening on, and the filename.

If you have gpfdist running on port 8000 in directory /localhome/gpadmin/Desktop:

CREATE EXTERNAL 
TABLE flightinfo (flightid int, airline_id int, carrier character(2), fl_num int)
LOCATION ('gpfdist://localhost:8000/flighttable.csv') FORMAT 'CSV';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top