25.10.2016 Views

SAP HANA Predictive Analysis Library (PAL)

sap_hana_predictive_analysis_library_pal_en

sap_hana_predictive_analysis_library_pal_en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. The records in the signature table must follow this order: first input table types, next parameter table<br />

type, and then output table types.<br />

3. The signature table must be created before generating the <strong>PAL</strong> procedure. The table type names are<br />

user-defined. You can find detailed table type definitions for each <strong>PAL</strong> function in Chapter 3.<br />

4. The names of all the generated procedures and the procedure parameter table types must be unique.<br />

The procedure names are defined by users. When generating a <strong>PAL</strong> procedure, make sure you give a<br />

unique procedure name.<br />

5. If you want to drop an existing procedure and then generate it again, you need to call the<br />

SYS.AFLLANG_WRAPPER_PROCEDURE_DROP procedure to clear the existing procedure. The syntax is<br />

as follows:<br />

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('','');<br />

6. The <strong>PAL</strong> procedure can be created under any schema once you have the CREATE ANY privileges of it.<br />

7. The current <strong>PAL</strong> does not support the decimal data type. If you have decimal columns in the base tables<br />

and want them to be replaced by double in the generated table types, you need to add the following<br />

entry in the signature table:<br />

(-2, '_SYS_AFL', 'CAST_DECIMAL_TO_DOUBLE', 'INOUT');<br />

(-1, '_SYS_AFL', 'CREATE_TABLE_TYPES', 'INOUT');<br />

Then the real tables or types should be inserted starting with ID1, as shown below:<br />

Table 2:<br />

Position Schema Name Table Type Name Parameter Type<br />

-2 _SYS_AFL CAST_DECIMAL_TO_DOU­<br />

BLE<br />

INOUT<br />

-1 _SYS_AFL CREATE_TABLE_TYPES INOUT<br />

1 IN<br />

2 <br />

IN<br />

3 OUT<br />

The implicit decimal-to-double conversion is done on SQL layer when a generated procedure with<br />

tables including decimal columns is called. Note that the <strong>PAL</strong> data precision will NOT be higher than<br />

double.<br />

8. The AFLLANG procedure generator described in this Step was introduced since <strong>SAP</strong> <strong>HANA</strong> SPS 09. For<br />

backward compatibility information, see <strong>SAP</strong> Note 2046767.<br />

Step 2 – Call a <strong>PAL</strong> Procedure<br />

After generating a <strong>PAL</strong> procedure, any user that has the AFL__SYS_AFL_AFL<strong>PAL</strong>_EXECUTE or<br />

AFL__SYS_AFL_AFL<strong>PAL</strong>_EXECUTE_WITH_GRANT_OPTION role can call the procedure, using the syntax<br />

below.<br />

CALL .(<br />

{,…},<br />

,<br />

{,…}) with overview;<br />

10 P U B L I C<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> (<strong>PAL</strong>)<br />

Getting Started with <strong>PAL</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!