沈楠
988f380833
Some checks failed
MJN/finance-dbt/pipeline/head There was a failure building this commit
17 lines
515 B
SQL
17 lines
515 B
SQL
/*
|
|
沪深交易日历
|
|
*/
|
|
{{
|
|
config(
|
|
materialized='table',
|
|
engine="MergeTree",
|
|
order_by='(exchange_id, date_id)',
|
|
)
|
|
}}
|
|
|
|
Select `Exchange`.`exchange_id` As `exchange_id`
|
|
, Cast(`StgCalendar`.`cal_date` As Int32) As `date_id`
|
|
, Cast(`StgCalendar`.`is_open` As Int8) As `is_open`
|
|
From {{ source('finance', 'stg.tushare_trade_calendar') }} As `StgCalendar` Final
|
|
All Inner Join {{ ref('dw.dim_exchange') }} As `Exchange` Final
|
|
On `StgCalendar`.`exchange` = `Exchange`.`ts_exchange_code` |