Select query against an external table using PXF protocol fails with the below error message
gpdb=# select * from test_data2; ERROR: remote component error (500) from '172.28.9.251:50070': Problem accessing /gpdb/v4/Fragmenter/getFragments. Reason: Server Error Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: user (libchurl.c:694)
There is no check for syntax validation while creating an external table using PXF. In the below example, there is a double slash after port number 50070, due to which the error is observed.
CREATE EXTERNAL TABLE test_data2 ( i text ) LOCATION ('pxf://hdm2:50070//user/rjain04/test_data2.txt?Fragmenter=HdfsDataFragmenter&Accessor=TextFileAccessor&Resolver=TextResolver') FORMAT 'TEXT' (DELIMITER = E'\t')
Drop the external table and recreate the table with correct syntax having LOCATION keyword with it's argument in single line.
CREATE EXTERNAL TABLE test_data2 ( i text ) LOCATION ('pxf://hdm2:50070/user/rjain04/test_data2.txt?Fragmenter=HdfsDataFragmenter&Accessor=TextFileAccessor&Resolver=TextResolver') FORMAT 'TEXT' (DELIMITER = E'\t')