Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env perl
use local::lib "./extlib/";
use Thrift;
use Thrift::Socket;
use Thrift::BufferedTransport;
use Thrift::BinaryProtocol;
use ThriftHive;
my $socket = Thrift::Socket->new("localhost", 10000);
$socket->setSendTimeout(600 * 1000); # 10min.
$socket->setRecvTimeout(600 * 1000);
my $transport = Thrift::BufferedTransport->new($socket);
my $protocol = Thrift::BinaryProtocol->new($transport);
my $client = ThriftHiveClient->new($protocol);
eval {
$transport->open();
$client->execute("select count(*) from p");
use Data::Dumper;
warn Dumper $client->fetchAll();
$transport->close();
};
if ($@) { print $@->{message}, "\n"; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.