Greenplum - external tables

3.3k views Asked by At

I have a set of tab delimited files located on a server location and I have created a meta data table and an external table with the same layout as the metadata table.

I wanted to know when I run the external table script in PgAdmin 3 is it supposed to load the external table with the data from the files (tab delimited files) on the server location?

I suppose it should, but when I run a SELECT query against the ext table it throws an error:

(ERROR:  http response code 404 from gpfdist)

How to go about this problem?

2

There are 2 answers

1
user2647763 - RIMD On

Did you specify Host:Port with text(input) file name in your external table definition?

Did you start your gpfdist on same folder that has your input text file?

Check whether your gpfdist online.

Post your external table script/meta data table script.

0
Tony On

Without the gpfdist instances running on my Redhat Greenplum servers I saw this error in our logs when attempting to use External Tables: ERROR: connection with gpfdist failed for gpfdist://172.xxx.xxx.xxx:8081/app/xxx/prod/data/file.2015-01-21-08-37-50-0001.txt. effective url: http://172.xxx.xxx.xxx:8081/app/xxx/prod/data/file.2015-01-21-08-37-50-0001.txt. error code = 111 (Connection refused) (seg2 slice1 hostnamexxxx:40002 pid=17585)

I started gpfdist running in the background on ports 8080 and 8081 (not sure why both), and I got a different error: ERROR: http response code 404 from gpfdist (gpfdist://172.xxx.xxx.xxx:8081/app/xxx/prod/data/file.2015-01-21-08-37-50-0001.txt): HTTP/1.0 404 file not found (url.c:343) (seg0 slice1 hostnamexxx:40000 pid=62012) (cdbdisp.c:1525)

I found I had to start gpfdist from the / directory (even trying with -d /app/xxx/prod/data did not work, nor did starting gpfdist from that directory) using these commands:

  • nohup /usr/local/greenplum/greenplum-db/bin/gpfdist -p 8081 -l /home/xxxmgr/8081.log &

  • nohup /usr/local/greenplum/greenplum-db/bin/gpfdist -p 8080 -l /home/xxxmgr/8080.log &

Now it is working fine. Good luck!