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


In reply to Missing version identifier - Thrift::API::HiveClient2 by kwh78239

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.