David Morel > Thrift-API-HiveClient2-0.003 > Thrift::API::HiveClient2

Download:
Thrift-API-HiveClient2-0.003.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.003   Source   Latest Release: Thrift-API-HiveClient2-0.013

NAME ^

Thrift::API::HiveClient2 - Perl to HiveServer2 Thrift API wrapper

VERSION ^

version 0.003

METHODS ^

new

Initialize the client object with the Hive server parameters

    my $client = Thrift::API::HiveClient2->new(
        <host name or IP, defaults to localhost>,
        <port, defaults to 10000>,
    );

connect

Open the connection on the server declared in the object's constructor.

     $client->connect() or die "Failed to connect";

execute

Run an HiveQl statement on an open connection.

    my $rh = $client->execute( <HiveQL statement> );

fetch

Returns an array(ref) of arrayrefs, like DBI's fetchall_arrayref.

    my $rv = $client->fetch( $rh, <maximum records to retrieve> );
    or
    my @rv = $client->fetch( $rh, <maximum records to retrieve> );

WARNING ^

Thrift in Perl currently doesn't support SASL, so authentication needs to be disabled for now on HiveServer2 by setting this property in your /etc/hive/conf/hive-site.xml. Although the property is documented, this *value* -which disables the SASL server transport- is not, AFAICT.

  <property>
    <name>hive.server2.authentication</name>
    <value>NOSASL</value>
  </property>

AUTHOR ^

David Morel <david.morel@amakuru.net>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2013 by David Morel & Booking.com. Portions are (c) R.Scaffidi, Thrift files are (c) Apache Software Foundation..

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
syntax highlighting: