Read Hive table using PXF fails with "Invalid Method Name: get_table_req"
search cancel

Read Hive table using PXF fails with "Invalid Method Name: get_table_req"

book

Article ID: 296495

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

When setting up a simple table to access information from Hive using PXF, you get the following error:
CREATE EXTERNAL TABLE test(id integer)
LOCATION ('pxf://kevin.test?PROFILE=Hive&server=copy_default')
FORMAT 'custom' (formatter='pxfwritable_import')
ENCODING 'UTF8';
ERROR: remote component error (500) from '127.0.0.1:5888': Type Exception Report Message javax.servlet.ServletException: org.apache.thrift.TApplicationException: Invalid method name: 'get_table_req' Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception javax.servlet.ServletException: javax.servlet.ServletException: org.apache.thrift.TApplicationException: Invalid method name: 'get_table_req' (libchurl.c:946) (seg24 slice1 xxx.xxx.xxx.xxx:40000 pid=26886) (cdbdisp.c:254)
DETAIL: External table test


Environment

Product Version: 5.24

Resolution

This is a misleading error message given by PXF. You can turn on debug inĀ $PXF_CONF/conf/pxf-log4j.properties file:
log4j.logger.org.greenplum.pxf.plugins.hive.HiveClientWrapper=DEBUG
log4j.logger.org.apache.hadoop.hive.metastore.HiveMetaStoreClientCompatibility1xx=DEBUG
Then use the following command to restart:
$GPHOME/pxf/bin/pxf

It should give you an indication of the real error message:
NoSuchObjectException(message:kevin.test table not found)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_table_result$get_table_resultStandardScheme.read(ThriftHiveMetastore.java:53358)
This suggests that the hive table doesn't exist. This error message issue will be fixed in a later version of PXF (v5.15+).