在SAP HANA中使用PAL的APRIORI函数时,为什么我的结果表没有显示任何结果?

时间:2019-04-25 08:20:16

标签: sql sap hana apriori

我正在SAP HANA中使用PAL的APRIORIRULE功能。执行一切正常,但是我的结果表不显示任何结果。

我拥有所用架构的所有必要权限。

SET SCHEMA KLEAKOCI;

DROP TYPE NEW_DATA;

CREATE TYPE NEW_DATA AS TABLE(

    "CUSTOMER" VARCHAR(200),

    "ITEM" VARCHAR(200)

);

DROP TYPE RESULT_T;

CREATE TYPE RESULT_T AS TABLE(

    "PRERULE" VARCHAR(500),

    "POSTRULE" VARCHAR(500),

    "SUPPORT" DOUBLE,

    "CONFIDENCE" DOUBLE,

    "LIFT" DOUBLE

);
DROP TYPE MODEL;

CREATE TYPE MODEL AS TABLE(

    "ID" INTEGER,

    "PMMLMODEL" VARCHAR(5000)

);
DROP TYPE CONTROL_T;

CREATE TYPE CONTROL_T AS TABLE(

    "NAME" VARCHAR(100),

    "INTARGS" INTEGER,

    "DOUBLEARGS" DOUBLE,

    "STRINGARGS" VARCHAR (100)

); 

DROP TABLE SIGNATURE;

CREATE COLUMN TABLE SIGNATURE (

    "POSITION" INT,

    "SCHEMA_NAME" NVARCHAR(256),

    "TYPE_NAME" NVARCHAR(256),

    "PARAMETER_TYPE" VARCHAR(7)

);

INSERT INTO SIGNATURE VALUES (1, 'KLEAKOCI', 'NEW_DATA', 'IN'); 

INSERT INTO SIGNATURE VALUES (2, 'KLEAKOCI', 'CONTROL_T', 'IN'); 

INSERT INTO SIGNATURE VALUES (3, 'KLEAKOCI', 'RESULT_T', 'OUT');

INSERT INTO SIGNATURE VALUES (4, 'KLEAKOCI', 'MODEL', 'OUT'); 


CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_DROP('KLEAKOCI', 'APRIORIPROC');


CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_CREATE('AFLPAL', 'APRIORIRULE', 
'KLEAKOCI', 'APRIORIPROC', "KLEAKOCI"."SIGNATURE");

DROP TABLE PAL_APRIORI;

CREATE COLUMN TABLE PAL_APRIORI LIKE NEW_DATA;


INSERT INTO PAL_APRIORI 

SELECT "customerNumber", "orderCode" 

FROM "assetCentral"."asset"

WHERE "customerNumber" IS NOT NULL AND "orderCode" IS NOT NULL

GROUP BY "customerNumber", "orderCode"

HAVING COUNT(*)  = 1

ORDER BY "customerNumber";

DROP TABLE #PAL_CONTROL_TBL;

CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_CONTROL_TBL(

    "NAME" VARCHAR(100), 

    "INTARGS" INTEGER, 

    "DOUBLEARGS" DOUBLE, 

    "STRINGARGS" VARCHAR (100)

);


INSERT INTO #PAL_CONTROL_TBL VALUES ('THREAD_NUMBER', 2, null, null);

INSERT INTO #PAL_CONTROL_TBL VALUES ('MIN_SUPPORT', null, 0.5, null);

INSERT INTO #PAL_CONTROL_TBL VALUES ('MIN_CONFIDENCE', null, 0.3, null);

INSERT INTO #PAL_CONTROL_TBL VALUES ('MIN_LIFT', null, 1.1, null);

INSERT INTO #PAL_CONTROL_TBL VALUES ('MAX_CONSEQUENT', 1, null, null);


DROP TABLE PAL_APRIORI_RESULT_TBL;

CREATE COLUMN TABLE PAL_APRIORI_RESULT_TBL LIKE RESULT_T;


DROP TABLE PAL_APRIORI_PMMLMODEL_TBL;

CREATE COLUMN TABLE PAL_APRIORI_PMMLMODEL_TBL LIKE MODEL;


CALL "KLEAKOCI"."APRIORIPROC"

("KLEAKOCI"."PAL_APRIORI", 

"KLEAKOCI"."#PAL_CONTROL_TBL",

"KLEAKOCI"."PAL_APRIORI_RESULT_TBL",

"KLEAKOCI"."PAL_APRIORI_PMMLMODEL_TBL")

 WITH overview;


SELECT * FROM "KLEAKOCI".PAL_APRIORI_RESULT_TBL;

SELECT * FROM "KLEAKOCI".PAL_APRIORI_PMMLMODEL_TBL;

我希望有一套规则,但是我得到的只是结果表的头,上面没有任何数据。

1 个答案:

答案 0 :(得分:0)

已解决:

将支持和置信度设置得非常低,因为输入表中有超过200万条记录。