I'm trying to query a database through Hive/Thrift in PHP. However, I am constantly getting an error:
TSocket: timed out reading 4 bytes from XYZ
I'm using a code from
https://cwiki.apache.org/Hive/hiveclient.html#HiveClient-PHP
along with this PHP Thrift Client
https://github.com/garamon/php-thrift-hive-client
My code:
<?php
$socket = new TSocket( 'XYZ', 12345 );
$socket->setSendTimeout(30 * 1000);
$socket->setRecvTimeout(30 * 1000);
$transport = new TBufferedTransport( $socket, 1024, 1024 );
$protocol = new TBinaryProtocol( $transport );
$client = new ThriftHiveClientEx( $protocol );
$transport->open();
$client->execute("my query");
?>
Note - I am able to connect with XYZ through console (telnet command).
I would appriciate any help. Thanks.