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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CREATE COLUMN TABLE <strong>PAL</strong>_ARIMAX_DATA_TBL LIKE <strong>PAL</strong>_ARIMAX_DATA_T;<br />

DROP TABLE #<strong>PAL</strong>_CONTROL_TBL;<br />

CREATE LOCAL TEMPORARY COLUMN TABLE #<strong>PAL</strong>_CONTROL_TBL ( "NAME" VARCHAR<br />

(50),"INTARGS" INTEGER,"DOUBLEARGS" DOUBLE,"STRINGARGS" VARCHAR (100));<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('P', 1,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('Q', 1,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('D', 0,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('METHOD', 1,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('STATIONARY', 1,null,null);<br />

DROP TABLE <strong>PAL</strong>_ARIMAX_MODEL_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_ARIMAX_MODEL_TBL LIKE <strong>PAL</strong>_ARIMAX_MODEL_T;<br />

CALL <strong>PAL</strong>_ARIIMAX_NON_EXCEPTION_PROC(<strong>PAL</strong>_ARIMAX_DATA_TBL, "#<strong>PAL</strong>_CONTROL_TBL");<br />

Expected Result<br />

2.6 Using <strong>PAL</strong> in <strong>SAP</strong> <strong>HANA</strong> AFM<br />

The <strong>SAP</strong> <strong>HANA</strong> Application Function Modeler (AFM) in <strong>SAP</strong> <strong>HANA</strong> Studio supports functions from <strong>PAL</strong> in<br />

flowgraph models. With the AFM, you can easily add <strong>PAL</strong> function nodes to your flowgraph, specify its<br />

parameters and input/output table types, and generate the procedure, all without writing any SQLScript code.<br />

You can also execute the procedure to get the output result of the function, and save the auto-generated<br />

SQLScript code for future use.<br />

The main procedure is as follows:<br />

1. Create a new flowgraph or open an existing flowgraph in the Project Explorer view.<br />

Note<br />

For details on how to create a flowgraph, see "Creating a Flowgraph" in <strong>SAP</strong> <strong>HANA</strong> Developer Guide for<br />

<strong>SAP</strong> <strong>HANA</strong> Studio<br />

2. Specify the target schema by selecting the flowgraph container and editing Target Schema in the<br />

Properties view.<br />

3. Add the input(s) for the flowgraph by doing the following:<br />

1. Right-click the input anchor region on the left side of the flowgraph container and choose Add Input.<br />

2. Edit the table types of the input by editing the signature the Properties view.<br />

Note<br />

You can also drag a table from the catalog in the Systems view to the input anchor region of the<br />

flowgraph container.<br />

4. Add a <strong>PAL</strong> function to the flowgraph by doing the following:<br />

1. Drag the function node from the <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> compartment of the Palette to the<br />

flowgraph editing area.<br />

2. Specify the input table types of the function by selecting the input anchor and editing its signature in<br />

the Properties view.<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> P U B L I C 13

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

Saved successfully!

Ooh no, something went wrong!