text: CREATE INPUT STREAM Aiu_HO
  (
  TDRID	string,
  SYSID	int,
  ORGCDRID	string,
  ABISCDRID	string,
  ACDRID	string,
  HOREFID	long,
  ZONEID	int,
  POOLID	int,
  SCCPID	string,
  STARTTIME	int,
  MILLISEC	int,
  ABIS	int,
  SRVSTAT	int,
  CDRSTAT	int,
  HO_TYPE	int,
  INTER_TYPE	int,
  NI	int,
  OPC	int,
  DPC	int,
  LINKTYPE	int,
  ACCESS_TYPE	int,
  IMSI	string,
  TMSI	string,
  MSISDN	string,
  IMEI	string,
  MCC	string,
  MNC	string,
  ORGLAC	string,
  ORGCI	string,
  TMNC	string,
  TARGETLAC	string,
  TARGETCI	string,
  LastLAC	string,
  LastCI	string,
  ORGRNCID	string,
  TARRNCID	string,
  HOREFNUM	int,
  CODEC	int,
  IPADDR	long,
  PORT	int,
  HOLD	int,
  HO_CAUSE	int,
  FirstTEI	int,
  Firstchannel	int,
  SumRxlevlUL	long,
  SumRxlevlDL	long,
  SumRxqualUL	long,
  SumRxqualDL	long,
  SumBspwr	long,
  SumMspwr	long,
  SumTA	long,
  TotalMRno	int,
  TOTALMRCOUNT	int,
  TotalFullRateMRno	int,
  TotalHalfRateMRno	int,
  SumRxquaUL0	int,
  SumRxquaUL1	int,
  SumRxquaUL2	int,
  SumRxquaUL3	int,
  SumRxquaUL4	int,
  SumRxquaUL5	int,
  SumRxquaUL6	int,
  SumRxquaUL7	int,
  SumRxquaDL0	int,
  SumRxquaDL1	int,
  SumRxquaDL2	int,
  SumRxquaDL3	int,
  SumRxquaDL4	int,
  SumRxquaDL5	int,
  SumRxquaDL6	int,
  SumRxquaDL7	int,
  TA01Count	int,
  Rxlevel_Down	int,
  Weak_coverage	int,
  Over_coverage	int,
  Imbalance	int,
  Interference	int,
  HO_REQUIRED_TIME	int,
  HO_REQUEST_TIME	int,
  HO_ACK_TIME	int,
  HO_CMD_TIME	int,
  HO_DETECT_TIME	int,
  HO_COMPT_TIME	int,
  ASSN_TIME	int,
  ASSN_CMPT_TIME	int,
  ALERT_TIME	int,
  ANSWER_TIME	int,
  DIRECTION	int,
  HOCHARTYPE	int,
  HO_IN_FAIL_TIME	int,
  HO_OUT_FAIL_TIME	int,
  HO_OUT_REJECT_TIME	int,
  CLEAR_REQ_TIME	int,
  END_TIME	int,
  PD	int,
  FIRFAILMSG	int,
  CAUSE	int,
  ENCRYPT_VERSION	int,
  RESERVED1	string,
  RESERVED2	string,
  RESERVED3	string,
  RESERVED4	long,
  RESERVED5	int,
  RESERVED6	int,
  RESERVED7	int,
  RESERVED8	int,
  FILELOCATION	string,
  OFFSET	int,
  HOMEMCC	string,
  HOMEMNC	string,
  HOMEPROID	int,
  HOMEAREAID	int,
  PROBEID	int,
  PROBEID2	int,
  GROUPID	int,
  LNKOPC	int,
  LNKDPC	int,
  LNKSRCIP	long,
  LNKSRCPORT	int,
  LNKDESTIP	long,
  LNKDESTPORT	int,
  Setup_time	int,
  AIuFirstXdrType	int,
  AfirstXdrID	string,
  MSCHOType	int,
  HOCallState	int,
  CallSrvType	int,
  HOINType	int,
  InitialMSC	int,
  InitialBSC	int,
  InitialMCC	string,
  InitialMNC	string,
  InitialLAC	string,
  InitialCI	string,
  InitialPOOLID	int,
  InitialAccess_Type	int,
  HOSourceMSC	int,
  HOSourceNI	int,
  HOSourcePOOLID	int,
  HOTargetMSC	int,
  HOTargetNI	int,
  HOTargetPOOLID	int,
  CALLDURATION	int,
  FIRFAILTIME	int,
  Layer1ID	int,
  Layer2ID	int,
  Layer3ID	int,
  Layer4ID	int,
  Layer5ID	int,
  Layer6ID	int
  )
      SERDE BinarySerDe
           PROPERTIES ("serde.binaryserde.attributeslength"="20,4,20,20,20,8,4,4,20,4,4,4,4,4,4,4,4,4,4,4,4,16,9,24,15,3,3,4,4,3,4,4,10,10,13,13,4,4,8,4,4,4,4,4,8,8,8,8,8,8,8,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,20,20,20,8,4,4,4,4,20,4,5,5,4,4,4,4,4,4,4,8,4,8,4,4,4,20,4,4,4,4,4,4,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4")
      SOURCE  "com.huawei.streaming.cql.toolkits.operators.TCPServerInputOperator"
           PROPERTIES ("operator.tcpserver.port" = "7999","operator.tcpserver.fixedlength"="883");
  
  CREATE OUTPUT STREAM Filter_HO
  (
   IMSI   STRING,
   EventID  STRING,
   HOCount  INT
  )
      SINK 'com.huawei.streaming.operator.outputstream.ConsolePrintOp'
          properties("operator.consoleprint.frequence"="1")  parallel 1;
  
  
  ------use case 1------------------
  --在15分钟滑动时间窗内，某个IMSI对应AIUHO单据的“SRVSTAT==1 AND CAUSE=(0，1，2)”次数大于20次，StreamSmart即触发事件上报。
  INSERT INTO Filter_HO
   SELECT IMSI, "Case1_Filter_HO" as EventID, count(IMSI) as HOCount FROM Aiu_HO(SRVSTAT=1 AND CAUSE in (0,1,2))[RANGE 15 minute SLIDE] GROUP BY IMSI HAVING HOCount > 20;
  
  submit application force filter;