kwh78239 has asked for the wisdom of the Perl Monks concerning the following question:
Oh great and noble PerlMonks, your help will be greatly appreciated. Having to go Hadoop as MySQL has run out of gas with the amount of data we have to manipulate these days.
CentOS 7.3, yum installed the Thrift::API::HiveClient2, connecting to a hiveserver2 server, so it looks like I have the proper software for this to work.
My test Perl code:
#!/usr/bin/perl use strict; use Thrift::API::HiveClient2; use Data::Dumper; use Try::Tiny; print "\ncreate hive client\n"; my $client = Thrift::API::HiveClient2->new( host => 'hadoop03', port = +> 10000, timeout => 300); print "\nconnect to hive client\n"; $client->connect() or die "\nFailed to connect\n"; try sub { print "\ngetting COUNT(*) with Hive\n"; my $sql = "SELECT COUNT(*) AS `RowCount` FROM DaysTable WHERE Tran +sactionDate = '2018-07-01';"; my $rowCnt = 0; print "\n before execute \n"; my $rows = $client->execute( "$sql" ) or die "\nexecute failed\n"; print "\n after execute \n"; while (my $row = $client->fetch_hashref( $rows )) { print "\n before rowCnt \n"; $rowCnt = $row->{ 'RowCount' }; } print "\n\n\tRows from <$sql>\n\t<$rowCnt>\n\n"; }, catch sub { print "\n at the catch\n"; print Dumper( $_ ); exit; };
Then I run it, I get this:
create hive client connect to hive client getting COUNT(*) with Hive before execute at the catch $VAR1 = bless( { 'code' => 0, 'message' => 'Missing version identifier' }, 'Thrift::TException' );
So, I can create the client, I can connect, but when I try and execute, I get this error. When I use Hue, I can get to the server and get data returned, so it looks like Hadoop is working. I've done searches on PerlMonks and the web and haven't come up with a good solution to this issue. A few folks have asked the question but not given enough supporting documentation.
I hope this gives you enough information, if not, let me know. Hopefully someone has seen this before and will be able to say,"Oh yeah, just do this."
Thanks in advance!
Ken Hylton
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Missing version identifier - Thrift::API::HiveClient2
by choroba (Cardinal) on Jul 25, 2018 at 11:48 UTC | |
by kwh78239 (Novice) on Jul 25, 2018 at 16:00 UTC | |
by kwh78239 (Novice) on Jul 27, 2018 at 20:44 UTC | |
by kwh78239 (Novice) on Jul 31, 2018 at 19:17 UTC |