-- Databricks notebook source
-- 源表：DWD.DWD_TD_IMS_MARKET_TA_ORDER
-- 目标表：DM.DM_IMS_TD_MARKET_PROPERTY

-- COMMAND ----------

update dwd.dwd_td_ims_market_ta_order
set
  market = 'Pulmicort VBP Benchmark Market'
where
  market = 'Pumicort VBP Benchmark Market'

-- COMMAND ----------

--dm market property 市场相关属性和market&ta 的排序 by qingli 20230425
insert overwrite table dm.dm_ims_td_market_property
select
  market_order,
  bu as bu,
  ta as ta_key,
  case
    when ta = 'ONC' then 'ONCO'
    else ta
  end as ta,
  market as market_key,
  case
    when market = 'ONC Market' then 'ONCO Market'
    else market
  end as market,
  null as svg,
  ta_order,
  from_utc_timestamp (current_timestamp(), 'UTC+8') ETL_INSERT_DT,
  from_utc_timestamp (current_timestamp(), 'UTC+8') ETL_UPDATE_DT
from
  dwd.dwd_td_ims_market_ta_order