Querying database through Hive/Thrift in PHP does not work Querying database through Hive/Thrift in PHP does not work hadoop hadoop

Querying database through Hive/Thrift in PHP does not work


I had a similar problem when starting with those exact same resources. It turns out the code is not recognizing whether it has timed out or whether it is blocking the port. I found this article which helped me:

https://issues.apache.org/jira/browse/THRIFT-347

In your TSocket.php code ( garamon_base_dir/lib/transport ) you have to edit approximately lines 223 through 236.

Where it says:

if( $buf === FALSE || $buf === '' ) { ...andif( $md['timed_out'] ) { ...and then againif( $md[timed_out'] ) { ...

change to (respectively):

if( $buf === FALSE ) { ...andif( true === $md['timed_out'] && false === $md['blocked'] )and finally if( true === $md['timed_out'] && false === $md['blocked'] )

Then it started working after this fix. Good luck!