Vektor代码库

来源:互联网 发布:sql 遍历select结果 编辑:程序博客网 时间:2024/05/23 19:22
        - operation: readView
          view: performance_visibility.notification.notification.fa_notification
          as: fa_notification


        - operation: union
          as: notification_union
          left: acct_notification
          right: fa_notification
          schema: union_schema


        - operation: derive
          as: notification_derived
          source: notification_union
          expressions:
            - 'toInt(notification_key) as notification_key_int'
            - ifThenElse(notification_key_int%5=1,"Account",
              ifThenElse(notification_key_int%5=2,"FA","")) as item_type
            - '"" as composite_sql'
            - '"Performed in bottom 5% of composite in the past month" as notification_desc'
            - |
              concat("Objective: ",
              ifThenElse(risk_type="NS","None Specified",
              ifThenElse(risk_type="OI","Income",
              ifThenElse(risk_type="OA","Aggressive Income",
              ifThenElse(risk_type="OC","Capital Appreciation",
              ifThenElse(risk_type="OS","Speculation",""))))),
              " > Age: ",toString(sub_category),
              " > Account Type: ",toString(account_type)) as composite_desc


        - operation: map
          as: notification_mapped
          source: notification_derived
          mappings:
            - source: notification_key
              target: notification_key_str
            - source: notification_key_int
              target: notification_key
            - source: account_type
              target: managed_status


        - operation: selectFields
          as: pv_notification_meta
          source: notification_mapped
          fields:
            - notification_key
            - item_type
            - notification_desc
            - composite_desc
            - composite_sql
            - managed_status
            - risk_type

            - sub_category


        - operation: join
          as: union_asst_perf
          mode: FULL_OUTER
          left: acct_asst
          right: acctperf
          mergeLeftAndRightKeys: true
          keys:
            - leftKey: acct_key
              rightKey: acct_key
            - leftKey: year
              rightKey: year
            - leftKey: month
              rightKey: month
            - leftKey: rate_source
              rightKey: rate_source


        - operation: filter
          source: acct_master
          as: acct_master_filter
          filter: toInt(year) = toInt(substr("${today}", 0, 4)) and toInt(month) = toInt(substr("${today}", 5, 7)) and fa_key !='NA'

0 0
原创粉丝点击