/scripts/ahub.form.attachments.js
0

How does SAP HANA PAL procedure work?

Nov 04, 2016 at 04:25 AM

116

avatar image
Former Member

Hi,

I understand that using the below function we create hana PAL procedures.

"SYS".AFLLANG_WRAPPER_PROCEDURE_CREATE

The above function creates a procedure like below,

My schema name - VGUPTA

i am using K means function to generate the procedure.

1) I want to know the actual code of the function KMEANS__OVERLOAD_2_4. Where can i find that?

CREATE PROCEDURE "VGUPTA"."PAL_KMEANS_PROC" ( IN p1 "VGUPTA"."PAL_KMEANS_DATA_T", IN p2 "VGUPTA"."PAL_CONTROL_T", OUT p3 "VGUPTA"."PAL_KMEANS_ASSIGNED_T", OUT p4 "VGUPTA"."PAL_KMEANS_CENTERS_T", OUT p5 "VGUPTA"."PAL_KMEANS_SIL_CENTERS_T", OUT p6 "VGUPTA"."PAL_KMEANS_STATISTIC_T" ) LANGUAGE AFLLANG SQL SECURITY INVOKER READS SQL DATA AS BEGIN AFLLANGVERSION='2'; SCHEMA='_SYS_AFL'; AREA='AFLPAL'; FUNCTION='KMEANS__OVERLOAD_2_4'; PARAMETERS=';"TABLE",in,TrexTable,,,,;"ID",,,INT,,INTEGER,;"V000",,,DOUBLE,,DOUBLE,;"V001",,,STRING,,VARCHAR,2;"V002",,,DOUBLE,,DOUBLE,;"TABLE",in,TrexTable,,,,;"NAME",,,STRING,,VARCHAR,100;"INTARGS",,,INT,,INTEGER,;"DOUBLEARGS",,,DOUBLE,,DOUBLE,;"STRINGARGS",,,STRING,,VARCHAR,100;"TABLE",out,TrexTable,,,,;"ID",,,INT,,INTEGER,;"CLUSTER",,,INT,,INTEGER,;"DISTANCE",,,DOUBLE,,DOUBLE,;"SLIGHT_SILHOUETTE",,,DOUBLE,,DOUBLE,;"TABLE",out,TrexTable,,,,;"CLUSTER_ID",,,INT,,INTEGER,;"V000",,,DOUBLE,,DOUBLE,;"V001",,,STRING,,VARCHAR,2;"V002",,,DOUBLE,,DOUBLE,;"TABLE",out,TrexTable,,,,;"CLUSTER_ID",,,INT,,INTEGER,;"SLIGHT_SILHOUETTE",,,DOUBLE,,DOUBLE,;"TABLE",out,TrexTable,,,,;"NAME",,,STRING,,VARCHAR,50;"VALUE",,,DOUBLE,,DOUBLE,;'; END

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Lars Breddemann
Nov 06, 2016 at 10:49 PM
2

The PAL library functions are interfaces to optimised C++ libraries that run within in the SAP HANA indexserver process. That means, that there is no SQL definition for these functions that you could look at.

You can consider them as built-in functions, just like JOIN, SELECT, CURRENT_DATE, etc.

For specific details on the implemented algorithm, please check the reference documentation.

Share
10 |10000 characters needed characters left characters exceeded
Denys van Kempen
Nov 04, 2016 at 09:14 AM
1

Hi Vivek,

Have you already looked at Philip's Predictive Analysis Library playlist on the SAP HANA Academy YouTube channel?

https://www.youtube.com/playlist?list=PLkzo92owKnVw05sPUtcKJM66fYfk9sG-g

There is one video about K-medians: https://www.youtube.com/watch?v=G5Ioi1TBLbA

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 05, 2016 at 02:49 AM
0

Hi Denys,

I have already looked at these videos but these videos does not explain about the in depth details of the PAL function generated.

The generated procedure code i have given above. This procedure uses function KMEANS__OVERLOAD_2_4 to calculate K -Means.

I wanted to see the SQL definition of this function .

thanks,

Vivek

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content