Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Querying Hive tables using DBD::ODBC

by poj (Abbot)
on Oct 29, 2018 at 07:34 UTC ( #1224821=note: print w/replies, xml ) Need Help??


in reply to Querying Hive tables using DBD::ODBC

->fetchall_arrayref fetches all records so you don't need to loop (unless you don't have enough memory to fetch and return all the rows in one go.)

my $rows = $sth->fetchall_arrayref; say Dumper $rows;

Try fetching each row using ->fetchrow_arrayref.

#while (my $row = $sth->fetchall_arrayref) {
while (my $row = $sth->fetchrow_arrayref) {
   say Dumper $row;
}
poj

Replies are listed 'Best First'.
Re^2: Querying Hive tables using DBD::ODBC
by astroboy (Chaplain) on Oct 29, 2018 at 20:20 UTC
    Duh! You wouldn't think I'd been using DBI since the late 90s! Thanks for the fresh pair of eyes - I couldn't see the wood for the trees

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1224821]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2022-05-23 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (81 votes). Check out past polls.

    Notices?