Statement crashes server connection org.apache.thrift.transport.TTransportException


#1

select tjoin1.rnum, tjoin1.c1,tjoin2.c2 from tjoin1 left outer join tjoin2 on tjoin1.c1=tjoin2.c1 and trim(tjoin2.c2)='BB’
Error: Query failed : org.apache.thrift.transport.TTransportException
SQLState: null
ErrorCode: 0

create table TJOIN1 ( RNUM integer not null , C1 integer, C2 integer);
insert into TJOIN1 ( RNUM, C1, C2) values ( 0, 10, 15);
insert into TJOIN1 ( RNUM, C1, C2) values ( 1, 20, 25);
insert into TJOIN1 ( RNUM, C1, C2) values ( 2, NULL, 50);

create table TJOIN2 ( RNUM integer not null , C1 integer, C2 varchar(2));
insert into TJOIN2 ( RNUM, C1, C2) values ( 0, 10, ‘BB’);
insert into TJOIN2 ( RNUM, C1, C2) values ( 1, 15, ‘DD’);
insert into TJOIN2 ( RNUM, C1, C2) values ( 2, NULL, ‘EE’);
insert into TJOIN2 ( RNUM, C1, C2) values ( 3, 10, ‘FF’);


#2

Hi

the error you are seeing is the result of the Db server crashing.

MAPD does not support th TRIM command.

unfortunately it is slipping by calcite and not being rejected currently by our analyzer which cause the ast to fail

actual error is

E0109 11:45:10.919489 20067 MapDHandler.cpp:2467] Syntax error at: B
F0109 11:46:19.858907 20067 RelAlgAbstractInterpreter.cpp:1648] Check failed: !query_ast.HasParseError()
*** Check failure stack trace: ***
    @     0x7fc75fffe5ad  google::LogMessage::Fail()
    @     0x7fc760000413  google::LogMessage::SendToLog()
    @     0x7fc75fffe13b  google::LogMessage::Flush()
    @     0x7fc760000dfe  google::LogMessageFatal::~LogMessageFatal()
    @     0x56174deb9cc6  deserialize_ra_dag()
    @     0x56174deee2ff  RelAlgExecutor::executeRelAlgQueryNoRetry()
    @     0x56174deeeff5  RelAlgExecutor::executeRelAlgQuery()
    @     0x56174dd04ded  MapDHandler::execute_rel_alg()
    @     0x56174dd0a6c7  MapDHandler::sql_execute_impl()
    @     0x56174dd0b22c  MapDHandler::sql_execute()
    @     0x56174dc2623e  MapDProcessor::process_sql_execute()
    @     0x56174dc120fe  MapDProcessor::dispatchCall()
    @     0x56174dcb9b65  apache::thrift::TDispatchProcessor::process()
    @     0x7fc75b54f642  apache::thrift::server::TConnectedClient::run()
    @     0x7fc75b5574c8  apache::thrift::server::TThreadedServer::TConnectedClientRunner::run()
    @     0x7fc75b55b64f  apache::thrift::concurrency::PthreadThread::threadMain()
    @     0x7fc75fddc6da  start_thread
    @     0x7fc75964cd7f  clone

if I remove the TRIM statement

result

mapdql> select tjoin1.rnum, tjoin1.c1,tjoin2.c2 from tjoin1 left outer join tjoin2 on tjoin1.c1=tjoin2.c1 and tjoin2.c2='BB';
rnum|c1|c2
0|10|BB
1|20|NULL
2|NULL|NULL
mapdql>

Will create a issue to detect TRIM earlier and reject

regards


#3

Hi

Issue #171 created https://github.com/mapd/mapd-core/issues/171

regards