I have an SQL Function that used to run perfectly fine when executed from SQL Console or via XSJS engine (using preparedStatement.executeQuery()).
We added some more logic and changed the returns table signature. After a drop and create function, it runs fine in SQL Console but fails when executed from XSJS engine.
We have lots of functions in development stage and have run into this problem every once in a while. Reason is unclear. It remains so even after restarting HANA engine. And then it can also vanish away just as mysteriously as it came.
Here is the trace from xsengine_alert_hanaserver.trc:
[24683]{0}[-195770] 2013-06-04 03:04:04.140828 e Executor | PlanExecutor.cpp(00268) : plan plan43@hanaserver:30007 failed with rc 260; invalid column nameinvalid column name: E.CREATED_ON: line 1 col 166 (at pos 165)Please check lines: 56, |
[24683]{0}[-195770] 2013-06-04 03:04:04.140848 e Executor | PlanExecutor.cpp(00268) : -- returns for plan43@hanaserver:30007: |
[24683]{0}[-195770] 2013-06-04 03:04:04.140853 e Executor | PlanExecutor.cpp(00268) : pop=pop1, class="ceSqlPop", duration=03:04:04.143 +0.005, MemAllocBytes=0, MemDeallocBytes=0, CacheLikeMemAllocBytes=0, CacheLikeMemDeallocBytes=0, rc=260, msg=invalid column name |
[24683]{0}[-195770] 2013-06-04 03:04:04.140866 e Executor | PlanExecutor.cpp(00268) : pop=<all>, duration=03:04:04.143 to 03:04:04.148 +0.005 |
[24683]{0}[-195770] 2013-06-04 03:04:04.140870 e Executor | PlanExecutor.cpp(00268) : con=a, class="ceDataSet", size=0 |
[24683]{0}[-195770] 2013-06-04 03:04:04.140874 e Executor | PlanExecutor.cpp(00268) : con=c, class="ceDataSet", size=0 |
[24683]{0}[-195770] 2013-06-04 03:04:04.140876 e Executor | PlanExecutor.cpp(00268) : con=<all>, duration=+0.000 |
[24683]{0}[-195770] 2013-06-04 03:04:04.140878 e Executor | PlanExecutor.cpp(00268) : -- end executor returns |
[24683]{0}[-195770] 2013-06-04 03:04:04.140879 e Executor | PlanExecutor.cpp(00268) : pop1 (rc 260, invalid column name) |
pop = executorPy.ceSqlPop() # pop1
pop.setNodeName('$$_SYS_SS2_RETURN_VAR_$$ZZZ')
pop.setUseInternalTable()
pop.addViewAttribute('Info1', datatype=83, intDigits=100, sqlType=30, sqlLength=100)
pop.addViewAttribute('Info2', datatype=73, intDigits=10, sqlType=3, sqlLength=10)
pop.addViewAttribute('Info3', datatype=83, intDigits=6, sqlType=29, sqlLength=6)
pop.setLocale('BINARY')
pop.setUserSchema('SYSTEM')
pop.addPlanDebugOpDataInfo(originalNodeName = '$$_SYS_SS2_RETURN_VAR_$$', scenarioName = 'SYSTEM:_SYS_SS_CE_200290_TMP', description = ' line 56 col 1 (at pos 1316)'
, sourceLines = [56])
pop.setSqlStatement(" SELECT * FROM ( SELECT XXXXXXXXX...
) ) ")
pop.setSchema('SYSTEM')
pop.setExecuteUser('SYSTEM')
[24683]{0}[-195770] 2013-06-04 03:04:04.141133 e cePlanExec cePlanExecutor.cpp(06208) : Error during Plan execution of model SYSTEM:_SYS_SS_CE_200290_RET (-1), reas on: invalid column name: ZZ.CREATED_ON: line 1 col 166 (at pos 165)Please check lines: 56,
The error from XSJS is as follows. "E.CREATED_ON" is part of the join fields but not part of the returns statement. It was added in logic change:
dberr: InternalError: dberror(PreparedStatement.executeQuery): 260 - invalid column name: [260] invalid column name: E.CREATED_ON: line 1 col 152 (at pos 151)Please check lines: 56, at ptime/query/plan_executor/trex_wrapper/trex_wrapper_body/trex_query.cc:828","timing":{"query_time":-1,"total_time":65},"qs":"SELECT * FROM SYSTEM.ZZZ( 320766 )","colheadings":{},"datarows":[],"rowcount":0}
Will appreciate if someone can shed a light on this. The haphazard nature of this error makes me worry about reliability of HANA application.
Thanks