Teradata加入索引错误

时间:2014-09-23 06:07:46

标签: teradata

我试图创建一个加入索引,但得到以下错误。不确定错误是什么。

创建索引失败5464:连接索引ddl出错,内部表上不能有null敏感表达式。 我还有一个问题..有没有办法强制优化器使用创建的连接索引。

CREATE JOIN INDEX  GEEDW_D_PLM_ODS_BULK_T.TEST_JI AS

SELECT T_PART.NM AS PART_NAME
,T_PART.DESCRIPTION AS PART_TITLE
,T_PART.REVISION
,DESN_RESPONSBLTY.FROM_NAME AS RDO
,T_PART.STATE AS PART_STATE
,PART_FAMILY.NM AS PART_FAMILY_NM
,PART_FAMILY.DESCRIPTION AS PART_FAMILY_DESCRIPTION
,PART_FAMILY.MXSYS_INTERFACE AS INTERFACE_NAME
,CASE WHEN T_PART.ID=INTER_REAL.ID THEN  INTER_REAL.INTERFACE_NAME 
             WHEN T_PART.ID=INTER_STRING.ID THEN  INTER_STRING.INTERFACE_NAME  
               WHEN T_PART.ID=INTER_INTIGER.ID THEN  INTER_INTIGER.INTERFACE_NAME
              WHEN T_PART.ID=INTER_BOLEAN.ID THEN  INTER_BOLEAN.INTERFACE_NAME
                  WHEN T_PART.ID=INTER_DATE.ID THEN  INTER_DATE.INTERFACE_NAME

END AS ATTRIBUTE_GROUP

,CASE WHEN T_PART.ID=INTER_REAL.ID THEN  INTER_REAL.ATTRIBUTE_NAME 
             WHEN T_PART.ID=INTER_STRING.ID THEN  INTER_STRING.ATTRIBUTE_NAME  
                WHEN T_PART.ID=INTER_INTIGER.ID THEN  INTER_INTIGER.ATTRIBUTE_NAME
            WHEN T_PART.ID=INTER_BOLEAN.ID THEN  INTER_BOLEAN.ATTRIBUTE_NAME
         WHEN T_PART.ID=INTER_DATE.ID THEN  INTER_DATE.ATTRIBUTE_NAME
END AS ATTRIBUTE_NM

,CASE WHEN T_PART.ID=INTER_REAL.ID THEN  CAST( INTER_REAL.ATTRIBUTE_VALUE  AS DECIMAL(18,6))
             WHEN T_PART.ID=INTER_STRING.ID THEN CAST( INTER_STRING.ATTRIBUTE_VALUE  AS VARCHAR(255))
               WHEN T_PART.ID=INTER_INTIGER.ID THEN CAST( INTER_INTIGER.ATTRIBUTE_VALUE AS INTEGER)
                WHEN T_PART.ID=INTER_BOLEAN.ID THEN CAST( INTER_BOLEAN.ATTRIBUTE_VALUE AS INTEGER)
             WHEN T_PART.ID=INTER_DATE.ID THEN  CAST(INTER_DATE.ATTRIBUTE_VALUE AS  VARCHAR(255))

END AS ATTRIBUTE_VALUE
FROM GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_T_PART_FAMILY_BKP PART_FAMILY
INNER JOIN GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_R_CLASSIFIED_ITEM_BKP CLASSIFIED_ITEM
ON PART_FAMILY.ID=CLASSIFIED_ITEM.FROM_ID
INNER  JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_T_PART_BKP T_PART
ON  CLASSIFIED_ITEM.TO_id=T_PART.ID
INNER JOIN GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_R_GE_OBJ_HST_BKP OBJ_HST
ON T_PART.ID=OBJ_HST.FROM_ID
INNER JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_R_DESN_RESPONSBLTY_BKP DESN_RESPONSBLTY
ON  T_PART.ID=DESN_RESPONSBLTY.TO_ID 
AND DESN_RESPONSBLTY.TO_TYPE IN('Part','GE Mfg/Svcs Kit Part','GE Vendor Part') AND DESN_RESPONSBLTY.FROM_TYPE='Department' 
LEFT OUTER JOIN GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_INTER_REAL_398850F1_BKP INTER_REAL
ON T_PART.ID=INTER_REAL.ID
AND PART_FAMILY.MXSYS_INTERFACE=INTER_REAL.ROOT_INTERFACE_NAME

LEFT OUTER JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_INTER_STRING_398850F1_BKP INTER_STRING
ON T_PART.ID=INTER_STRING.ID
AND PART_FAMILY.MXSYS_INTERFACE=INTER_STRING.ROOT_INTERFACE_NAME

LEFT OUTER JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_INTR_INTGR_398850F1_BKP INTER_INTIGER
ON T_PART.ID=INTER_INTIGER.ID
AND PART_FAMILY.MXSYS_INTERFACE=INTER_INTIGER.ROOT_INTERFACE_NAME

LEFT OUTER JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_INTR_BOLEN_398850F1_BKP INTER_BOLEAN
ON T_PART.ID=INTER_BOLEAN.ID
AND PART_FAMILY.MXSYS_INTERFACE=INTER_BOLEAN.ROOT_INTERFACE_NAME

LEFT OUTER JOIN  GEEDW_D_PLM_ODS_BULK_T.CDR_ODS_INTER_DATE_398850F1_BKP INTER_DATE
ON T_PART.ID=INTER_DATE.ID
AND PART_FAMILY.MXSYS_INTERFACE=INTER_DATE.ROOT_INTERFACE_NAME
WHERE ATTRIBUTE_GROUP IS NOT NULL
GROUP BY 1,2,3,4,5,6,7,8,9,10,11
PRIMARY INDEX(PART_NAME)

0 个答案:

没有答案