Closed tsubasawzj closed 9 years ago
Have a look at https://rt.cpan.org/Public/Bug/Display.html?id=86679 the patch i posted will help you figure out the Thrift error (Thrift by default dies on errors, but with a less than helpful error message). Also, you can have a look at your hiveserver2.log file (IIRC) on the server.
Can this ticket be closed?
@dmorel
When I use the execute method of Thrift::API::HiveClient2, it will be throw 'TApplicationException=HASH(0x18f0780)' such an exception。
Here is my code: my $client = Thrift::API::HiveClient2->new(host => "10.10.0.201",port => "10000"); $client->connect() or die "Failed to connect"; my $rh=""; $rh=$client->execute( 'use mcp' ) or die "execute() failed: $rh->{status}{errorMessage} (code: $rh->{status}{errorCode})";
debug is as follows main::(./test.pl:8): my $client = Thrift::API::HiveClient2->new(host => "10.10.0.201",port => "10000",timeout =>'10000'); #timeout => <seconds timeout, defaults to 1 hour> DB<1> n main::(./test.pl:9): $client->connect() or die "Failed to connect"; DB<1> n main::(./test.pl:10): my $rh=""; DB<1> n main::(./test.pl:11): $rh=$client->execute( 'use mcp' ) or die "execute() failed: $rh->{status}{errorMessage} (code: $rh->{status}{errorCode})";; DB<1> n at /usr/local/share/perl5/Thrift/API/HiveClient2/TCLIService.pm line 2591. Thrift::API::HiveClient2::TCLIServiceClient::recv_OpenSession('Thrift::API::HiveClient2::TCLIServiceClient=HASH(0x21be518)') called at /usr/local/share/perl5/Thrift/API/HiveClient2/TCLIService.pm line 2564 Thrift::API::HiveClient2::TCLIServiceClient::OpenSession('Thrift::API::HiveClient2::TCLIServiceClient=HASH(0x21be518)', 'Thrift::API::HiveClient2::TOpenSessionReq=HASH(0x2493e98)') called at /usr/local/share/perl5/Thrift/API/HiveClient2.pm line 133 Thrift::API::HiveClient2::_build_session('Thrift::API::HiveClient2=HASH(0x22528e0)') called at (eval 28)[/usr/local/share/perl5/Sub/Quote.pm:5] line 9 Thrift::API::HiveClient2::_session('Thrift::API::HiveClient2=HASH(0x22528e0)') called at /usr/local/share/perl5/Thrift/API/HiveClient2.pm line 151 Thrift::API::HiveClient2::_build_session_handle('Thrift::API::HiveClient2=HASH(0x22528e0)') called at (eval 27)[/usr/local/share/perl5/Sub/Quote.pm:5] line 9 Thrift::API::HiveClient2::_session_handle('Thrift::API::HiveClient2=HASH(0x22528e0)') called at /usr/local/share/perl5/Thrift/API/HiveClient2.pm line 158 Thrift::API::HiveClient2::execute('Thrift::API::HiveClient2=HASH(0x22528e0)', 'use mcp') called at ./test.pl line 11
session open failed.Could tell me which method can do this thing?Thank you very much.