hadoop2greenplumhawq

Select query not working on external table


We have a small array of Greenplum cluster. In that we installed Hadoop. and trying to access external table using GPHDFS protocol.

ENV

Getting error

prod=# select count (*) from schemaname.filename;
ERROR: external table gphdfs protocol command ended with error. Error: A JNI error has occurred, please check your installation and try again (seg1 slice1 datanaodehostname:40001 pid=8221)
DETAIL:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce/TaskAttemptContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMain
Command: 'gphdfs://hadoop/file/path?profile=HdfsTextSimple'
External table ext_tableneme, file gphdfs://hadoop/file/path?profile=HdfsTextSimple

Any help on it would be much appreciated?


Solution

  • in psql, run "show gp_hadoop_home" You should see it points to your HDP home. If not, use gpconfig -c gp_hadoop_home -v "'/usr/hdp/current" to reset the hadoop home in gpdb.