Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How does HANA resolve input parameters in calculation views executed in the SQL Engine?

$
0
0

Hello,

 

In our project, we use HANA stored procedures called from ABAP using DB proxy (this is from a time where AMDP was not yet available).

However, we previously refactored the procedures in a way that all (mass) data centric operations  (read, convert and further process data) are done inside using graphical calculation views  which are executed in the SQL engine.

 

Now, with the same version of the HANA server we experience that there is a difference if we execute the procedure from ABAP versus executing it on a standalone HANA server.

In detail, executing the same code in the standalone HANA server is successful whereas executing it from ABAP runs into an error:

[6608]{236093}[39/391650361] 2015-07-02 11:13:08.217560 e cePlanExec       cePlanExecutor.cpp(07222) : Error during Plan execution of model _SYS_BIC:_SYS_SS_CE_232022928_139889446946000_2_INS (-1), reason: "_SYS_BIC"."sap.is.ddf.udf/SP_SWP_MODEL": line 51 col 5 (at pos 1692): [2048] (range 3): column store error:  [2048] "_SYS_BIC"."sap.is.ddf.udf/SP_SW_MODEL": line 36 col 5 (at pos 1009): [2048] (range 3): column store error:  [2048] "_SYS_BIC"."sap.is.ddf.udf/SP_SW_MODEL_POS": line 43 col 5 (at pos 1961): [2048] (range 3): column store error: search table error:  [6968] Evaluator: syntax error in expression string;expected TK_RPAREN,parsing 'longdate(2013-07-31 [here]23:59:59.0000000)'Please check lines: 59

 

It does not look so but the error actually occurs in a graphical calculation view executed from a procedure.

The root cause is that only the standalone server accepts a calculated column of type TIMESTAMP containing the input parameter placeholder of type timestamp: $$P_TimestampFrom$$. The fix was to change $$P_TimestampFrom$$ to '$$P_TimestampFrom$$'.

 

 

Now the questions:

1) Why does it sometimes work without single quotes and sometimes not?

    In Detail: What is different when we call procedures via DB proxy from ABAP versus standalone HANA server?

 

 

2) How do input parameters - where their placeholders are used - get resolved in graphical calculation views with enforced execution in the SQL engine?

-> We were concerned about too many conversions which would badly influence performance with mass data.

We would like to avoid that the timestamp input parameter is converted to a string because of the quotes: '$$P_TimestampFrom$$' and then converted back to timestamp.

We previously assumed this would not be the case without the single quotes. However, the assumption seems to be wrong anyway as there seem to be implicit conversions when the graphical calculation view is converted into SQL.

Are any input parameters always converted into strings when the placeholders ($$P_TimestampFrom$$) are used, independent of their defined type?

Is there any detailed explanation how those input parameters are resolved in filters or calculated columns (SQL Execution!) ?

 

 

Thanks,

Daniel


Viewing all articles
Browse latest Browse all 6412

Trending Articles