Net::Presto::Statement - Presto client statement object
use Net::Presto; my $presto = Net::Presto->new(...); my $sth = $presto->execute('SELECT * FROM ...'); while (my $rows = $sth->fetch) { my @column_names = $sth->column_names; for my $row (@$rows) { my @columns = @$row; # ArrayRef } } while (my $rows = $sth->fetch_hashref) { for my $row (@$rows) { $row->{column_name}; # HashRef } } $sth->cancel; # cancel the statement # do callback on each requests $sth->poll(sub { my $res = shift; my $data = $res->{data}; my $stats = $res->{stats}; # stop polling by return false return 0 if $stats->{status} eq 'FINISHED'; 1; # continue });
Net::Presto statement handler object.
$sth->fetch() :ArrayRef[ArrayRef[Str]]
Fetch next data as ArrayRef.
$sth->fetch_hashref() :ArrayRef[HashRef[Str]]
Fetch next data as HashRef.
$sth->columns() :ArrayRef[HashRef[Str]]
Returns column data.
$sth->columns_names() :(Str,...)
Returns column names.
$sth->cancel() :Bool
Cancel the query.
$sth->wait_for_completion() :Void
Wait until the query is completed.
$sth->poll($callback) :Void
Do $callback on each HTTP requests.
Net::Presto
Jiro Nishiguchi <jiro@cpan.org>
To install Net::Presto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Presto
CPAN shell
perl -MCPAN -e shell install Net::Presto
For more information on module installation, please visit the detailed CPAN module installation guide.