[ https://issues.apache.org/jira/browse/TRAFODION-3052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Wayne Birdsall closed TRAFODION-3052. ------------------------------------------- > Core in pCode evaluator for query on million-row non-partitioned table > ---------------------------------------------------------------------- > > Key: TRAFODION-3052 > URL: https://issues.apache.org/jira/browse/TRAFODION-3052 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp > Affects Versions: 2.2.0, 2.3 > Reporter: David Wayne Birdsall > Assignee: David Wayne Birdsall > Priority: Major > Fix For: 2.3 > > > The following script reproduces the problem. When preparing the query, we > obtain a core with the stack trace shown below. > {quote}?section setup > drop table if exists PCodeCore; > create table PCodeCore ( id varchar(20) not null, > PCodeCorexid varchar(20), > PCodeCoreyid varchar(20), > otherstuff char(10), > primary key (id) ); > upsert using load into PCodeCore > select cast(c0+10*c1+100*c2+1000*c3+10000*c4+100000*c5 as varchar(20)), > cast(c1+10*c2+100*c3+1000*c4+10000*c5+100000*c0 as varchar(20)), > cast(c2+10*c3+100*c4+1000*c5+10000*c0+100000*c1 as varchar(20)), > cast(c0+7*c1+49*c2+343*c3+2401*c4+16807*c5 as char(10)) > from (values(1)) t > transpose 0,1,2,3,4,5,6,7,8,9 as c0 > transpose 0,1,2,3,4,5,6,7,8,9 as c1 > transpose 0,1,2,3,4,5,6,7,8,9 as c2 > transpose 0,1,2,3,4,5,6,7,8,9 as c3 > transpose 0,1,2,3,4,5,6,7,8,9 as c4 > transpose 0,1,2,3,4,5,6,7,8,9 as c5; > update statistics for table PCodeCore on every column; > ?section s1 > -- causes a core > prepare s1 from select otherstuff,count(*) from PCodeCore group by otherstuff; > {quote} > The stack trace follows: > {quote}(gdb) bt > #0 0x00007efeb774f495 in raise () from /lib64/libc.so.6 > #1 0x00007efeb7750bfd in abort () from /lib64/libc.so.6 > #2 0x00007efeb774860e in __assert_fail_base () from /lib64/libc.so.6 > #3 0x00007efeb77486d0 in __assert_fail () from /lib64/libc.so.6 > #4 0x00007efeb3d7e919 in ex_expr::evalPCode (this=0x7efe95309eb8, > pCode32=0x7efe95309fd8, atp1=0x7efe9530a240, atp2=0x0, datalen=-1, > rowLen=0x0) at ../exp/exp_eval.cpp:2352 > #5 0x00007efeb61a8f06 in ex_expr::eval (this=0x7efe95309eb8, > atp1=0x7efe9530a240, atp2=0x0, exHeap=0x7efe95866280, datalen=-1, > rowLen=0x0, lastFldIndex=0x0, fetchedDataPtr=0x0) at ../exp/exp_expr.h:371 > #6 0x00007efeafb71c42 in ValueIdList::evalAtCompileTime (this=0x7fffa642fb70, > addConvNodes=1, tf=ExpTupleDesc::SQLMX_KEY_FORMAT, resultBuffer=0x0, > resultBufferLength=0, length=0x7fffa642fda8, offset=0x7fffa642fdac, > diagsArea=0x7efea4bb2208) at ../optimizer/ValueDesc.cpp:4689 > #7 0x00007efeafb71f98 in ValueIdList::evaluateTree (root=0x7efe952ff8d0, > encodedKeyBuffer=0x0, encodedKeyLength=0, length=0x7fffa642fda8, > offset=0x7fffa642fdac, diagsArea=0x7efea4bb2208) > at ../optimizer/ValueDesc.cpp:4741 > #8 0x00007efeaf82ec48 in createRangePartitionBoundariesFromStats (idesc= > 0x7efe958353a8, hist=..., numberOfPartitions=4, partColArray=..., > partitioningKeyColumnsOrder=..., statsColsCount=1, heap=0x7efe95866280) > at ../optimizer/NATable.cpp:2327 > #9 0x00007efeaf949f18 in FileScan::createRangePartFuncForHbaseTableUsingStats > (this=0x7efe952f7b88, partns=@0x7fffa64301bc, partitioningKeyColumns=..., > partitioningKeyColumnsList=..., partitioningKeyColumnsOrder=...) > at ../optimizer/OptPhysRelExpr.cpp:14795 > #10 0x00007efeaf94a863 in FileScan::synthHbaseScanPhysicalProperty ( > this=0x7efe952f7b88, context=0x7efe952e82b0, planNumber=-1, > sortOrderVEG=...) at ../optimizer/OptPhysRelExpr.cpp:14977 > #11 0x00007efeaf94b351 in FileScan::synthPhysicalProperty ( > this=0x7efe952f7b88, myContext=0x7efe952e82b0, planNumber=-1, > pws=0x7efe952eade8) at ../optimizer/OptPhysRelExpr.cpp:15197 > #12 0x00007efeaf9268c3 in RelExpr::createPlan (this=0x7efe952f7b88, > myContext=0x7efe952e82b0, pws=0x7efe952eade8, rule=0x7efea4bdfcd0, > guidance=0x0, guidanceForChild=@0x7fffa6430578) > at ../optimizer/OptPhysRelExpr.cpp:216 > #13 0x00007efeafb24da1 in CreatePlanTask::perform (this=0x7efe952ead98, > taskId=24) at ../optimizer/tasks.cpp:1486 > #14 0x00007efeaf8d926d in QueryOptimizerDriver::optimizeAPassHelper ( > this=0x7fffa6434b50, context=0x7efe952f04e0) at ../optimizer/opt.cpp:7042 > #15 0x00007efeaf8d8e00 in QueryOptimizerDriver::optimizeAPass ( > this=0x7fffa6434b50, context=0x7efe952f04e0) at ../optimizer/opt.cpp:6975 > #16 0x00007efeaf8d8a24 in QueryOptimizerDriver::doPass2PerhapsPass1 ( > this=0x7fffa6434b50, relExpr=0x7efe95815608, context=0x7efe952f04e0, > original=0x7efe952e32b0) at ../optimizer/opt.cpp:6902 > #17 0x00007efeaf8d7a0c in RelExpr::optimize2 (this=0x7efe95815608) > at ../optimizer/opt.cpp:6598 > #18 0x00007efeaf90b4bc in RelExpr::optimizeNode (this=0x7efe95815608) > at ../optimizer/OptLogRelExpr.cpp:76 > #19 0x00007efeb1427fe9 in CmpMain::compile (this=0x7fffa6438540, > input_str=0x7efe95867d48 "select otherstuff,count(*) from PCodeCore group by > otherstuff;", charset=15, queryExpr=@0x7fffa6438438, gen_code=0x7efe9581b8e0, > gen_code_len=0x7efe9581b8d8, heap=0x7efe95866280, phase=CmpMain::END, > fragmentDir=0x7fffa6438698, op=3004, useQueryCache=CmpMain::NORMAL, > cacheable=0x7fffa6438424, begTime=0x7fffa6438440, shouldLog=0) > at ../sqlcomp/CmpMain.cpp:2264 > #20 0x00007efeb1425dc7 in CmpMain::sqlcomp (this=0x7fffa6438540, > input_str=0x7efe95867d48 "select otherstuff,count(*) from PCodeCore group by > otherstuff;", charset=15, queryExpr=@0x7fffa6438438, gen_code=0x7efe9581b8e0, > gen_code_len=0x7efe9581b8d8, heap=0x7efe95866280, phase=CmpMain::END, > fragmentDir=0x7fffa6438698, op=3004, useQueryCache=CmpMain::NORMAL, > cacheable=0x7fffa6438424, begTime=0x7fffa6438440, shouldLog=0) > at ../sqlcomp/CmpMain.cpp:1657 > #21 0x00007efeb14236b7 in CmpMain::sqlcomp (this=0x7fffa6438540, input=..., > gen_code=0x7efe9581b8e0, gen_code_len=0x7efe9581b8d8, heap=0x7efe95866280, > phase=CmpMain::END, fragmentDir=0x7fffa6438698, op=3004, > useQueryCache=CmpMain::NORMAL) at ../sqlcomp/CmpMain.cpp:773 > #22 0x00007efeb69e99c1 in CmpStatement::process (this=0x7efe95865030, > sqltext=...) at ../arkcmp/CmpStatement.cpp:500 > #23 0x00007efeb69d9112 in CmpContext::compileDirect (this=0x7efea4bb1090, > data=0x7efeba4fbad0 "h", data_len=168, outHeap=0x7efeba529ce0, charset=15, > op=CmpMessageObj::SQLTEXT_COMPILE, gen_code=@0x7fffa6438bc0, > gen_code_len=@0x7fffa6438bcc, parserFlags=0, parentQid=0x0, > parentQidLen=0, diagsArea=@0x7fffa6438b98) at ../arkcmp/CmpContext.cpp:829 > #24 0x00007efeb7488577 in Statement::prepare2 (this=0x7efeba4cb4c8, > source=0x7efeba4fd660 "select otherstuff,count(*) from PCodeCore group by > otherstuff;", diagsArea=..., passed_gen_code=0x0, passed_gen_code_len=0, > charset=15, unpackTdbs=1, cliFlags=144) at ../cli/Statement.cpp:1706 > #25 0x00007efeb74876ce in Statement::prepare (this=0x7efeba4cb4c8, > source=0x7efeba4fd660 "select otherstuff,count(*) from PCodeCore group by > otherstuff;", diagsArea=..., passed_gen_code=0x0, passed_gen_code_len=0, > charset=15, unpackTdbs=1, cliFlags=144) at ../cli/Statement.cpp:1372 > #26 0x00007efeb740cdf9 in SQLCLI_Prepare2 (cliGlobals=0x2076ca0, > statement_id=0x5bea310, sql_source=0x5c1afe0, gencode_ptr=0x0, > gencode_len=0, ret_gencode_len=0x0, query_cost_info=0x7fffa643a240, > query_comp_stats_info=0x7fffa6438fb0, uniqueStmtId=0x7fffa643a0b0 " ", > uniqueStmtIdLen=0x7fffa643a300, flags=128) at ../cli/Cli.cpp:5459 > #27 0x00007efeb74a6f75 in SQL_EXEC_Prepare2 (statement_id=0x5bea310, > sql_source=0x5c1afe0, gencode_ptr=0x0, gencode_len=0, ret_gencode_len=0x0, > query_cost_info=0x7fffa643a240, comp_stats_info=0x7fffa6438fb0, > uniqueStmtId=0x7fffa643a0b0 " ", uniqueStmtIdLen=0x7fffa643a300, > flags=128) at ../cli/CliExtern.cpp:4657 > #28 0x00007efeb9dd7350 in SqlCmd::do_prepare (sqlci_env=0x205f840, > prep_stmt=0x6156610, > sqlStmt=0x4f3ef20 "select otherstuff,count(*) from PCodeCore group by > otherstuff;", resetLastExecStmt=1, rsIndex=0, prepcode=0x0, > statisticsType=0x0) > at ../sqlci/SqlCmd.cpp:1032 > #29 0x00007efeb9ddd5ac in Prepare::process (this=0x5148ee0, > sqlci_env=0x205f840) at ../sqlci/SqlCmd.cpp:3085 > #30 0x00007efeb9dc51a4 in Obey::process (this=0x5bb0f90, sqlci_env=0x205f840) > at ../sqlci/Obey.cpp:253 > #31 0x00007efeb9dce042 in SqlciEnv::executeCommands (this=0x205f840, > input_stmt=@0x7fffa643a5f8) at ../sqlci/SqlciEnv.cpp:821 > #32 0x00007efeb9dcd783 in SqlciEnv::run (this=0x205f840) > at ../sqlci/SqlciEnv.cpp:632 > #33 0x0000000000402308 in main (argc=1, argv=0x7fffa643a7b8) > at ../bin/SqlciMain.cpp:326 > (gdb){quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)