First of all thank you so much for taking the time to reply to my question.
When I do that I get this error
PHP Parse error: syntax error, unexpected ';', expecting T_STRING or
T_NS_SEPARATOR or '{' in
/apache-hive-0.14.0-SNAPSHOT-bin/lib/php/packages/hive_service/ThriftHive.php
on line 2
and on line 2 of that file it says
namespace ;
Thanks
On 03/28/2014 04:15 AM, Chinna Rao Lalam wrote:
> Hi,
>
> 1. Start Hiveserver
> 2. In php client code set THRIFT_ROOT to php lib of hive distribution (Ex:
> /home/install/apache-hive-0.14.0-SNAPSHOT-bin/lib/php)
>
> Hope It Helps,
> Chinna
>
>
> On Fri, Mar 28, 2014 at 12:14 AM, Jeremy <[email protected]
> <mailto:[email protected]>> wrote:
>
> Or how do query hive from php?
>
> On 03/27/2014 12:25 PM, Jeremy wrote:
> > Or is there another way I can pull data from hive using php?
> >
> > On 03/27/2014 11:54 AM, Jeremy wrote:
> >>
> https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-PHP
> >>
> >> What kind of setup and what do I need to do to get this client to run?
> >>
> >>
> >> <?php
> >> // set THRIFT_ROOT to php directory of the hive distribution
> >> $GLOBALS['THRIFT_ROOT'] = '/lib/php/';
> >> // load the required files for connecting to Hive
> >> require_once $GLOBALS['THRIFT_ROOT'] .
> >> 'packages/hive_service/ThriftHive.php';
> >> require_once $GLOBALS['THRIFT_ROOT'] . 'transport/TSocket.php';
> >> require_once $GLOBALS['THRIFT_ROOT'] . 'protocol/TBinaryProtocol.php';
> >> // Set up the transport/protocol/client
> >> $transport = new TSocket('localhost', 10000);
> >> $protocol = new TBinaryProtocol($transport);
> >> $client = new ThriftHiveClient($protocol);
> >> $transport->open();
> >>
> >> // run queries, metadata calls etc
> >> $client->execute('SELECT * from src');
> >> var_dump($client->fetchAll());
> >> $transport->close();
> >>
> >> Thanks
> >>
>
>