[{"data":1,"prerenderedAt":1853},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fru\u002Fdata\u002Fdbt-bigquery-sovremennyi-stack-marketingovyh-dannyh":13},{"i18nKey":4,"paths":5},"data-002-2026-05",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Fdata\u002Fdbt-bigquery-moderne-marketing-data-stack","\u002Fen\u002Fdata\u002Fmodern-marketing-data-stack-with-dbt-bigquery","\u002Fes\u002Fdata\u002Fdbt-bigquery-modern-data-stack-marketing","\u002Ffr\u002Fdata\u002Fdbt-bigquery-modern-marketing-data-stack","\u002Fit\u002Fdata\u002Fdbt-bigquery-modern-marketing-data-stack","\u002Fru\u002Fdata\u002Fdbt-bigquery-sovremennyi-stack-marketingovyh-dannyh","\u002Ftr\u002Fdata\u002Fdbt-bigquery-ile-modern-pazarlama-data-stack",{"_path":11,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":1847,"_id":1848,"_source":1849,"_file":1850,"_stem":1851,"_extension":1852},"data",false,"","dbt + BigQuery: современный стек маркетинговых данных","Source mapping, modeling layer, semantic layer, exposures — четырёхуровневая архитектура, связывающая маркетинговые данные с механизмом принятия решений.","2026-05-10",[21,22,23,24,25],"dbt","bigquery","data-modeling","semantic-layer","marketing-analytics",8,"Roibase",{"type":29,"children":30,"toc":1839},"root",[31,39,46,60,81,391,397,418,453,1191,1197,1233,1257,1545,1551,1571,1576,1681,1687,1692,1733,1796,1802,1807,1828,1833],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36],{"type":37,"value":38},"text","Маркетинговые команды получают больше данных, чем когда-либо, но решения принимают на основе предположений. Отчёты, собранные в таблицах, показывают разные цифры на каждом дашборде, а на вопрос «Какая реальная стоимость привлечения клиента?» звучат три разных ответа. Проблема не в недостатке данных — проблема в потерях на пути от источника к инсайту. Комбинация dbt + BigQuery создаёт архитектуру, которая устраняет эти потери: source mapping собирает сырые данные, modeling layer преобразует их в бизнес-логику, semantic layer создаёт единый язык для команды, exposures открывают данные для production-использования.",{"type":32,"tag":40,"props":41,"children":43},"h2",{"id":42},"source-mapping-от-сырых-данных-к-надёжному-источнику",[44],{"type":37,"value":45},"Source Mapping: от сырых данных к надёжному источнику",{"type":32,"tag":33,"props":47,"children":48},{},[49,51,58],{"type":37,"value":50},"Source mapping — первый уровень dbt, первая трансформация маркетинговых данных после загрузки в BigQuery. Сырые события из Google Ads API, Meta Ads, Shopify попадают в staging-слой и стандартизируются. Модель ",{"type":32,"tag":52,"props":53,"children":55},"code",{"className":54},[],[56],{"type":37,"value":57},"stg_google_ads__campaign_performance",{"type":37,"value":59}," содержит 127 столбцов, но вы используете 12. Source mapping выбирает эти 12, преобразует временные метки в UTC, приводит campaign_id к типу string, обрабатывает NULL-значения и создаёт чистую таблицу.",{"type":32,"tag":33,"props":61,"children":62},{},[63,65,71,73,79],{"type":37,"value":64},"В BigQuery source-определения хранятся в файле ",{"type":32,"tag":52,"props":66,"children":68},{"className":67},[],[69],{"type":37,"value":70},"sources.yml",{"type":37,"value":72},". Здесь же задаются проверки freshness — если данные из Google Ads не приходили последние 2 часа, dbt run считается ошибкой. Это enforced contract: pipeline становится надёжнее. Вместо прямого select из raw table используется макрос ",{"type":32,"tag":52,"props":74,"children":76},{"className":75},[],[77],{"type":37,"value":78},"{{ source('google_ads', 'campaign_stats') }}",{"type":37,"value":80}," — dbt lineage graph показывает, какая raw table питает какую модель.",{"type":32,"tag":82,"props":83,"children":87},"pre",{"className":84,"code":85,"language":86,"meta":16,"style":16},"language-yaml shiki shiki-themes github-dark","sources:\n  - name: google_ads\n    database: production\n    schema: raw_google_ads\n    tables:\n      - name: campaign_stats\n        freshness:\n          warn_after: {count: 2, period: hour}\n          error_after: {count: 6, period: hour}\n        columns:\n          - name: campaign_id\n            tests:\n              - not_null\n              - unique\n","yaml",[88],{"type":32,"tag":52,"props":89,"children":90},{"__ignoreMap":16},[91,109,134,152,170,183,205,218,270,316,329,351,364,378],{"type":32,"tag":92,"props":93,"children":96},"span",{"class":94,"line":95},"line",1,[97,103],{"type":32,"tag":92,"props":98,"children":100},{"style":99},"--shiki-default:#85E89D",[101],{"type":37,"value":102},"sources",{"type":32,"tag":92,"props":104,"children":106},{"style":105},"--shiki-default:#E1E4E8",[107],{"type":37,"value":108},":\n",{"type":32,"tag":92,"props":110,"children":112},{"class":94,"line":111},2,[113,118,123,128],{"type":32,"tag":92,"props":114,"children":115},{"style":105},[116],{"type":37,"value":117},"  - ",{"type":32,"tag":92,"props":119,"children":120},{"style":99},[121],{"type":37,"value":122},"name",{"type":32,"tag":92,"props":124,"children":125},{"style":105},[126],{"type":37,"value":127},": ",{"type":32,"tag":92,"props":129,"children":131},{"style":130},"--shiki-default:#9ECBFF",[132],{"type":37,"value":133},"google_ads\n",{"type":32,"tag":92,"props":135,"children":137},{"class":94,"line":136},3,[138,143,147],{"type":32,"tag":92,"props":139,"children":140},{"style":99},[141],{"type":37,"value":142},"    database",{"type":32,"tag":92,"props":144,"children":145},{"style":105},[146],{"type":37,"value":127},{"type":32,"tag":92,"props":148,"children":149},{"style":130},[150],{"type":37,"value":151},"production\n",{"type":32,"tag":92,"props":153,"children":155},{"class":94,"line":154},4,[156,161,165],{"type":32,"tag":92,"props":157,"children":158},{"style":99},[159],{"type":37,"value":160},"    schema",{"type":32,"tag":92,"props":162,"children":163},{"style":105},[164],{"type":37,"value":127},{"type":32,"tag":92,"props":166,"children":167},{"style":130},[168],{"type":37,"value":169},"raw_google_ads\n",{"type":32,"tag":92,"props":171,"children":173},{"class":94,"line":172},5,[174,179],{"type":32,"tag":92,"props":175,"children":176},{"style":99},[177],{"type":37,"value":178},"    tables",{"type":32,"tag":92,"props":180,"children":181},{"style":105},[182],{"type":37,"value":108},{"type":32,"tag":92,"props":184,"children":186},{"class":94,"line":185},6,[187,192,196,200],{"type":32,"tag":92,"props":188,"children":189},{"style":105},[190],{"type":37,"value":191},"      - ",{"type":32,"tag":92,"props":193,"children":194},{"style":99},[195],{"type":37,"value":122},{"type":32,"tag":92,"props":197,"children":198},{"style":105},[199],{"type":37,"value":127},{"type":32,"tag":92,"props":201,"children":202},{"style":130},[203],{"type":37,"value":204},"campaign_stats\n",{"type":32,"tag":92,"props":206,"children":208},{"class":94,"line":207},7,[209,214],{"type":32,"tag":92,"props":210,"children":211},{"style":99},[212],{"type":37,"value":213},"        freshness",{"type":32,"tag":92,"props":215,"children":216},{"style":105},[217],{"type":37,"value":108},{"type":32,"tag":92,"props":219,"children":220},{"class":94,"line":26},[221,226,231,236,240,246,251,256,260,265],{"type":32,"tag":92,"props":222,"children":223},{"style":99},[224],{"type":37,"value":225},"          warn_after",{"type":32,"tag":92,"props":227,"children":228},{"style":105},[229],{"type":37,"value":230},": {",{"type":32,"tag":92,"props":232,"children":233},{"style":99},[234],{"type":37,"value":235},"count",{"type":32,"tag":92,"props":237,"children":238},{"style":105},[239],{"type":37,"value":127},{"type":32,"tag":92,"props":241,"children":243},{"style":242},"--shiki-default:#79B8FF",[244],{"type":37,"value":245},"2",{"type":32,"tag":92,"props":247,"children":248},{"style":105},[249],{"type":37,"value":250},", ",{"type":32,"tag":92,"props":252,"children":253},{"style":99},[254],{"type":37,"value":255},"period",{"type":32,"tag":92,"props":257,"children":258},{"style":105},[259],{"type":37,"value":127},{"type":32,"tag":92,"props":261,"children":262},{"style":130},[263],{"type":37,"value":264},"hour",{"type":32,"tag":92,"props":266,"children":267},{"style":105},[268],{"type":37,"value":269},"}\n",{"type":32,"tag":92,"props":271,"children":273},{"class":94,"line":272},9,[274,279,283,287,291,296,300,304,308,312],{"type":32,"tag":92,"props":275,"children":276},{"style":99},[277],{"type":37,"value":278},"          error_after",{"type":32,"tag":92,"props":280,"children":281},{"style":105},[282],{"type":37,"value":230},{"type":32,"tag":92,"props":284,"children":285},{"style":99},[286],{"type":37,"value":235},{"type":32,"tag":92,"props":288,"children":289},{"style":105},[290],{"type":37,"value":127},{"type":32,"tag":92,"props":292,"children":293},{"style":242},[294],{"type":37,"value":295},"6",{"type":32,"tag":92,"props":297,"children":298},{"style":105},[299],{"type":37,"value":250},{"type":32,"tag":92,"props":301,"children":302},{"style":99},[303],{"type":37,"value":255},{"type":32,"tag":92,"props":305,"children":306},{"style":105},[307],{"type":37,"value":127},{"type":32,"tag":92,"props":309,"children":310},{"style":130},[311],{"type":37,"value":264},{"type":32,"tag":92,"props":313,"children":314},{"style":105},[315],{"type":37,"value":269},{"type":32,"tag":92,"props":317,"children":319},{"class":94,"line":318},10,[320,325],{"type":32,"tag":92,"props":321,"children":322},{"style":99},[323],{"type":37,"value":324},"        columns",{"type":32,"tag":92,"props":326,"children":327},{"style":105},[328],{"type":37,"value":108},{"type":32,"tag":92,"props":330,"children":332},{"class":94,"line":331},11,[333,338,342,346],{"type":32,"tag":92,"props":334,"children":335},{"style":105},[336],{"type":37,"value":337},"          - ",{"type":32,"tag":92,"props":339,"children":340},{"style":99},[341],{"type":37,"value":122},{"type":32,"tag":92,"props":343,"children":344},{"style":105},[345],{"type":37,"value":127},{"type":32,"tag":92,"props":347,"children":348},{"style":130},[349],{"type":37,"value":350},"campaign_id\n",{"type":32,"tag":92,"props":352,"children":354},{"class":94,"line":353},12,[355,360],{"type":32,"tag":92,"props":356,"children":357},{"style":99},[358],{"type":37,"value":359},"            tests",{"type":32,"tag":92,"props":361,"children":362},{"style":105},[363],{"type":37,"value":108},{"type":32,"tag":92,"props":365,"children":367},{"class":94,"line":366},13,[368,373],{"type":32,"tag":92,"props":369,"children":370},{"style":105},[371],{"type":37,"value":372},"              - ",{"type":32,"tag":92,"props":374,"children":375},{"style":130},[376],{"type":37,"value":377},"not_null\n",{"type":32,"tag":92,"props":379,"children":381},{"class":94,"line":380},14,[382,386],{"type":32,"tag":92,"props":383,"children":384},{"style":105},[385],{"type":37,"value":372},{"type":32,"tag":92,"props":387,"children":388},{"style":130},[389],{"type":37,"value":390},"unique\n",{"type":32,"tag":40,"props":392,"children":394},{"id":393},"modeling-layer-бизнес-логика-как-код",[395],{"type":37,"value":396},"Modeling Layer: бизнес-логика как код",{"type":32,"tag":33,"props":398,"children":399},{},[400,402,408,410,416],{"type":37,"value":401},"После staging следуют слои intermediate и mart — здесь к маркетинговым данным применяется бизнес-логика. В модели ",{"type":32,"tag":52,"props":403,"children":405},{"className":404},[],[406],{"type":37,"value":407},"int_campaign_attribution",{"type":37,"value":409}," вычисляются first-touch и last-touch attribution. В таблице ",{"type":32,"tag":52,"props":411,"children":413},{"className":412},[],[414],{"type":37,"value":415},"fct_customer_lifetime_value",{"type":37,"value":417}," проводится анализ LTV по когортам. Эти модели работают с использованием incremental materialization dbt — каждый run обрабатывает только данные последних 3 дней, старые записи не трогаются. Таблица customer_event содержит 40 миллионов строк, но благодаря incremental стратегии каждый run занимает 2 минуты.",{"type":32,"tag":33,"props":419,"children":420},{},[421,423,429,430,436,437,443,445,451],{"type":37,"value":422},"На уровне mart создаются таблицы для отдельных бизнес-подразделений: ",{"type":32,"tag":52,"props":424,"children":426},{"className":425},[],[427],{"type":37,"value":428},"mart_paid_media__daily_performance",{"type":37,"value":250},{"type":32,"tag":52,"props":431,"children":433},{"className":432},[],[434],{"type":37,"value":435},"mart_crm__email_engagement",{"type":37,"value":250},{"type":32,"tag":52,"props":438,"children":440},{"className":439},[],[441],{"type":37,"value":442},"mart_finance__revenue_attribution",{"type":37,"value":444},". Эти таблицы подключаются к Looker Studio, Tableau, Amplitude — каждый берёт свой метрик из одного источника. Стоимость привлечения клиента больше не предмет обсуждения, потому что формула ",{"type":32,"tag":52,"props":446,"children":448},{"className":447},[],[449],{"type":37,"value":450},"paid_media_spend \u002F new_customers",{"type":37,"value":452}," определена в dbt-модели. Она прошла code review, протестирована, находится под версионным контролем.",{"type":32,"tag":82,"props":454,"children":458},{"className":455,"code":456,"language":457,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","-- models\u002Fmarts\u002Fpaid_media\u002Fmart_paid_media__daily_performance.sql\n{{ config(materialized='incremental', unique_key='date_campaign_id') }}\n\nwith campaign_spend as (\n  select\n    date,\n    campaign_id,\n    sum(cost_micros) \u002F 1e6 as spend\n  from {{ ref('stg_google_ads__campaign_performance') }}\n  {% if is_incremental() %}\n    where date >= date_sub(current_date(), interval 3 day)\n  {% endif %}\n  group by 1, 2\n),\n\nconversions as (\n  select\n    date(timestamp) as date,\n    campaign_id,\n    count(distinct user_id) as conversions\n  from {{ ref('stg_ga4__conversions') }}\n  {% if is_incremental() %}\n    where date(timestamp) >= date_sub(current_date(), interval 3 day)\n  {% endif %}\n  group by 1, 2\n)\n\nselect\n  c.date,\n  c.campaign_id,\n  c.spend,\n  coalesce(cv.conversions, 0) as conversions,\n  safe_divide(c.spend, nullif(cv.conversions, 0)) as cpa\nfrom campaign_spend c\nleft join conversions cv using (date, campaign_id)\n","sql",[459],{"type":32,"tag":52,"props":460,"children":461},{"__ignoreMap":16},[462,471,509,518,541,549,562,570,602,624,642,680,688,710,718,726,743,751,786,794,826,847,863,908,916,936,944,952,961,984,1005,1026,1075,1144,1158],{"type":32,"tag":92,"props":463,"children":464},{"class":94,"line":95},[465],{"type":32,"tag":92,"props":466,"children":468},{"style":467},"--shiki-default:#6A737D",[469],{"type":37,"value":470},"-- models\u002Fmarts\u002Fpaid_media\u002Fmart_paid_media__daily_performance.sql\n",{"type":32,"tag":92,"props":472,"children":473},{"class":94,"line":111},[474,479,485,490,495,499,504],{"type":32,"tag":92,"props":475,"children":476},{"style":105},[477],{"type":37,"value":478},"{{ config(materialized",{"type":32,"tag":92,"props":480,"children":482},{"style":481},"--shiki-default:#F97583",[483],{"type":37,"value":484},"=",{"type":32,"tag":92,"props":486,"children":487},{"style":130},[488],{"type":37,"value":489},"'incremental'",{"type":32,"tag":92,"props":491,"children":492},{"style":105},[493],{"type":37,"value":494},", unique_key",{"type":32,"tag":92,"props":496,"children":497},{"style":481},[498],{"type":37,"value":484},{"type":32,"tag":92,"props":500,"children":501},{"style":130},[502],{"type":37,"value":503},"'date_campaign_id'",{"type":32,"tag":92,"props":505,"children":506},{"style":105},[507],{"type":37,"value":508},") }}\n",{"type":32,"tag":92,"props":510,"children":511},{"class":94,"line":136},[512],{"type":32,"tag":92,"props":513,"children":515},{"emptyLinePlaceholder":514},true,[516],{"type":37,"value":517},"\n",{"type":32,"tag":92,"props":519,"children":520},{"class":94,"line":154},[521,526,531,536],{"type":32,"tag":92,"props":522,"children":523},{"style":481},[524],{"type":37,"value":525},"with",{"type":32,"tag":92,"props":527,"children":528},{"style":105},[529],{"type":37,"value":530}," campaign_spend ",{"type":32,"tag":92,"props":532,"children":533},{"style":481},[534],{"type":37,"value":535},"as",{"type":32,"tag":92,"props":537,"children":538},{"style":105},[539],{"type":37,"value":540}," (\n",{"type":32,"tag":92,"props":542,"children":543},{"class":94,"line":172},[544],{"type":32,"tag":92,"props":545,"children":546},{"style":481},[547],{"type":37,"value":548},"  select\n",{"type":32,"tag":92,"props":550,"children":551},{"class":94,"line":185},[552,557],{"type":32,"tag":92,"props":553,"children":554},{"style":481},[555],{"type":37,"value":556},"    date",{"type":32,"tag":92,"props":558,"children":559},{"style":105},[560],{"type":37,"value":561},",\n",{"type":32,"tag":92,"props":563,"children":564},{"class":94,"line":207},[565],{"type":32,"tag":92,"props":566,"children":567},{"style":105},[568],{"type":37,"value":569},"    campaign_id,\n",{"type":32,"tag":92,"props":571,"children":572},{"class":94,"line":26},[573,578,583,588,593,597],{"type":32,"tag":92,"props":574,"children":575},{"style":242},[576],{"type":37,"value":577},"    sum",{"type":32,"tag":92,"props":579,"children":580},{"style":105},[581],{"type":37,"value":582},"(cost_micros) ",{"type":32,"tag":92,"props":584,"children":585},{"style":481},[586],{"type":37,"value":587},"\u002F",{"type":32,"tag":92,"props":589,"children":590},{"style":105},[591],{"type":37,"value":592}," 1e6 ",{"type":32,"tag":92,"props":594,"children":595},{"style":481},[596],{"type":37,"value":535},{"type":32,"tag":92,"props":598,"children":599},{"style":105},[600],{"type":37,"value":601}," spend\n",{"type":32,"tag":92,"props":603,"children":604},{"class":94,"line":272},[605,610,615,620],{"type":32,"tag":92,"props":606,"children":607},{"style":481},[608],{"type":37,"value":609},"  from",{"type":32,"tag":92,"props":611,"children":612},{"style":105},[613],{"type":37,"value":614}," {{ ref(",{"type":32,"tag":92,"props":616,"children":617},{"style":130},[618],{"type":37,"value":619},"'stg_google_ads__campaign_performance'",{"type":32,"tag":92,"props":621,"children":622},{"style":105},[623],{"type":37,"value":508},{"type":32,"tag":92,"props":625,"children":626},{"class":94,"line":318},[627,632,637],{"type":32,"tag":92,"props":628,"children":629},{"style":105},[630],{"type":37,"value":631},"  {% ",{"type":32,"tag":92,"props":633,"children":634},{"style":481},[635],{"type":37,"value":636},"if",{"type":32,"tag":92,"props":638,"children":639},{"style":105},[640],{"type":37,"value":641}," is_incremental() %}\n",{"type":32,"tag":92,"props":643,"children":644},{"class":94,"line":331},[645,650,655,660,665,670,675],{"type":32,"tag":92,"props":646,"children":647},{"style":481},[648],{"type":37,"value":649},"    where",{"type":32,"tag":92,"props":651,"children":652},{"style":481},[653],{"type":37,"value":654}," date",{"type":32,"tag":92,"props":656,"children":657},{"style":481},[658],{"type":37,"value":659}," >=",{"type":32,"tag":92,"props":661,"children":662},{"style":105},[663],{"type":37,"value":664}," date_sub(current_date(), interval ",{"type":32,"tag":92,"props":666,"children":667},{"style":242},[668],{"type":37,"value":669},"3",{"type":32,"tag":92,"props":671,"children":672},{"style":481},[673],{"type":37,"value":674}," day",{"type":32,"tag":92,"props":676,"children":677},{"style":105},[678],{"type":37,"value":679},")\n",{"type":32,"tag":92,"props":681,"children":682},{"class":94,"line":353},[683],{"type":32,"tag":92,"props":684,"children":685},{"style":105},[686],{"type":37,"value":687},"  {% endif %}\n",{"type":32,"tag":92,"props":689,"children":690},{"class":94,"line":366},[691,696,701,705],{"type":32,"tag":92,"props":692,"children":693},{"style":481},[694],{"type":37,"value":695},"  group by",{"type":32,"tag":92,"props":697,"children":698},{"style":242},[699],{"type":37,"value":700}," 1",{"type":32,"tag":92,"props":702,"children":703},{"style":105},[704],{"type":37,"value":250},{"type":32,"tag":92,"props":706,"children":707},{"style":242},[708],{"type":37,"value":709},"2\n",{"type":32,"tag":92,"props":711,"children":712},{"class":94,"line":380},[713],{"type":32,"tag":92,"props":714,"children":715},{"style":105},[716],{"type":37,"value":717},"),\n",{"type":32,"tag":92,"props":719,"children":721},{"class":94,"line":720},15,[722],{"type":32,"tag":92,"props":723,"children":724},{"emptyLinePlaceholder":514},[725],{"type":37,"value":517},{"type":32,"tag":92,"props":727,"children":729},{"class":94,"line":728},16,[730,735,739],{"type":32,"tag":92,"props":731,"children":732},{"style":105},[733],{"type":37,"value":734},"conversions ",{"type":32,"tag":92,"props":736,"children":737},{"style":481},[738],{"type":37,"value":535},{"type":32,"tag":92,"props":740,"children":741},{"style":105},[742],{"type":37,"value":540},{"type":32,"tag":92,"props":744,"children":746},{"class":94,"line":745},17,[747],{"type":32,"tag":92,"props":748,"children":749},{"style":481},[750],{"type":37,"value":548},{"type":32,"tag":92,"props":752,"children":754},{"class":94,"line":753},18,[755,759,764,769,774,778,782],{"type":32,"tag":92,"props":756,"children":757},{"style":481},[758],{"type":37,"value":556},{"type":32,"tag":92,"props":760,"children":761},{"style":105},[762],{"type":37,"value":763},"(",{"type":32,"tag":92,"props":765,"children":766},{"style":481},[767],{"type":37,"value":768},"timestamp",{"type":32,"tag":92,"props":770,"children":771},{"style":105},[772],{"type":37,"value":773},") ",{"type":32,"tag":92,"props":775,"children":776},{"style":481},[777],{"type":37,"value":535},{"type":32,"tag":92,"props":779,"children":780},{"style":481},[781],{"type":37,"value":654},{"type":32,"tag":92,"props":783,"children":784},{"style":105},[785],{"type":37,"value":561},{"type":32,"tag":92,"props":787,"children":789},{"class":94,"line":788},19,[790],{"type":32,"tag":92,"props":791,"children":792},{"style":105},[793],{"type":37,"value":569},{"type":32,"tag":92,"props":795,"children":797},{"class":94,"line":796},20,[798,803,807,812,817,821],{"type":32,"tag":92,"props":799,"children":800},{"style":242},[801],{"type":37,"value":802},"    count",{"type":32,"tag":92,"props":804,"children":805},{"style":105},[806],{"type":37,"value":763},{"type":32,"tag":92,"props":808,"children":809},{"style":481},[810],{"type":37,"value":811},"distinct",{"type":32,"tag":92,"props":813,"children":814},{"style":105},[815],{"type":37,"value":816}," user_id) ",{"type":32,"tag":92,"props":818,"children":819},{"style":481},[820],{"type":37,"value":535},{"type":32,"tag":92,"props":822,"children":823},{"style":105},[824],{"type":37,"value":825}," conversions\n",{"type":32,"tag":92,"props":827,"children":829},{"class":94,"line":828},21,[830,834,838,843],{"type":32,"tag":92,"props":831,"children":832},{"style":481},[833],{"type":37,"value":609},{"type":32,"tag":92,"props":835,"children":836},{"style":105},[837],{"type":37,"value":614},{"type":32,"tag":92,"props":839,"children":840},{"style":130},[841],{"type":37,"value":842},"'stg_ga4__conversions'",{"type":32,"tag":92,"props":844,"children":845},{"style":105},[846],{"type":37,"value":508},{"type":32,"tag":92,"props":848,"children":850},{"class":94,"line":849},22,[851,855,859],{"type":32,"tag":92,"props":852,"children":853},{"style":105},[854],{"type":37,"value":631},{"type":32,"tag":92,"props":856,"children":857},{"style":481},[858],{"type":37,"value":636},{"type":32,"tag":92,"props":860,"children":861},{"style":105},[862],{"type":37,"value":641},{"type":32,"tag":92,"props":864,"children":866},{"class":94,"line":865},23,[867,871,875,879,883,887,892,896,900,904],{"type":32,"tag":92,"props":868,"children":869},{"style":481},[870],{"type":37,"value":649},{"type":32,"tag":92,"props":872,"children":873},{"style":481},[874],{"type":37,"value":654},{"type":32,"tag":92,"props":876,"children":877},{"style":105},[878],{"type":37,"value":763},{"type":32,"tag":92,"props":880,"children":881},{"style":481},[882],{"type":37,"value":768},{"type":32,"tag":92,"props":884,"children":885},{"style":105},[886],{"type":37,"value":773},{"type":32,"tag":92,"props":888,"children":889},{"style":481},[890],{"type":37,"value":891},">=",{"type":32,"tag":92,"props":893,"children":894},{"style":105},[895],{"type":37,"value":664},{"type":32,"tag":92,"props":897,"children":898},{"style":242},[899],{"type":37,"value":669},{"type":32,"tag":92,"props":901,"children":902},{"style":481},[903],{"type":37,"value":674},{"type":32,"tag":92,"props":905,"children":906},{"style":105},[907],{"type":37,"value":679},{"type":32,"tag":92,"props":909,"children":911},{"class":94,"line":910},24,[912],{"type":32,"tag":92,"props":913,"children":914},{"style":105},[915],{"type":37,"value":687},{"type":32,"tag":92,"props":917,"children":919},{"class":94,"line":918},25,[920,924,928,932],{"type":32,"tag":92,"props":921,"children":922},{"style":481},[923],{"type":37,"value":695},{"type":32,"tag":92,"props":925,"children":926},{"style":242},[927],{"type":37,"value":700},{"type":32,"tag":92,"props":929,"children":930},{"style":105},[931],{"type":37,"value":250},{"type":32,"tag":92,"props":933,"children":934},{"style":242},[935],{"type":37,"value":709},{"type":32,"tag":92,"props":937,"children":939},{"class":94,"line":938},26,[940],{"type":32,"tag":92,"props":941,"children":942},{"style":105},[943],{"type":37,"value":679},{"type":32,"tag":92,"props":945,"children":947},{"class":94,"line":946},27,[948],{"type":32,"tag":92,"props":949,"children":950},{"emptyLinePlaceholder":514},[951],{"type":37,"value":517},{"type":32,"tag":92,"props":953,"children":955},{"class":94,"line":954},28,[956],{"type":32,"tag":92,"props":957,"children":958},{"style":481},[959],{"type":37,"value":960},"select\n",{"type":32,"tag":92,"props":962,"children":964},{"class":94,"line":963},29,[965,970,975,980],{"type":32,"tag":92,"props":966,"children":967},{"style":242},[968],{"type":37,"value":969},"  c",{"type":32,"tag":92,"props":971,"children":972},{"style":105},[973],{"type":37,"value":974},".",{"type":32,"tag":92,"props":976,"children":977},{"style":242},[978],{"type":37,"value":979},"date",{"type":32,"tag":92,"props":981,"children":982},{"style":105},[983],{"type":37,"value":561},{"type":32,"tag":92,"props":985,"children":987},{"class":94,"line":986},30,[988,992,996,1001],{"type":32,"tag":92,"props":989,"children":990},{"style":242},[991],{"type":37,"value":969},{"type":32,"tag":92,"props":993,"children":994},{"style":105},[995],{"type":37,"value":974},{"type":32,"tag":92,"props":997,"children":998},{"style":242},[999],{"type":37,"value":1000},"campaign_id",{"type":32,"tag":92,"props":1002,"children":1003},{"style":105},[1004],{"type":37,"value":561},{"type":32,"tag":92,"props":1006,"children":1008},{"class":94,"line":1007},31,[1009,1013,1017,1022],{"type":32,"tag":92,"props":1010,"children":1011},{"style":242},[1012],{"type":37,"value":969},{"type":32,"tag":92,"props":1014,"children":1015},{"style":105},[1016],{"type":37,"value":974},{"type":32,"tag":92,"props":1018,"children":1019},{"style":242},[1020],{"type":37,"value":1021},"spend",{"type":32,"tag":92,"props":1023,"children":1024},{"style":105},[1025],{"type":37,"value":561},{"type":32,"tag":92,"props":1027,"children":1029},{"class":94,"line":1028},32,[1030,1035,1039,1044,1048,1053,1057,1062,1066,1070],{"type":32,"tag":92,"props":1031,"children":1032},{"style":242},[1033],{"type":37,"value":1034},"  coalesce",{"type":32,"tag":92,"props":1036,"children":1037},{"style":105},[1038],{"type":37,"value":763},{"type":32,"tag":92,"props":1040,"children":1041},{"style":242},[1042],{"type":37,"value":1043},"cv",{"type":32,"tag":92,"props":1045,"children":1046},{"style":105},[1047],{"type":37,"value":974},{"type":32,"tag":92,"props":1049,"children":1050},{"style":242},[1051],{"type":37,"value":1052},"conversions",{"type":32,"tag":92,"props":1054,"children":1055},{"style":105},[1056],{"type":37,"value":250},{"type":32,"tag":92,"props":1058,"children":1059},{"style":242},[1060],{"type":37,"value":1061},"0",{"type":32,"tag":92,"props":1063,"children":1064},{"style":105},[1065],{"type":37,"value":773},{"type":32,"tag":92,"props":1067,"children":1068},{"style":481},[1069],{"type":37,"value":535},{"type":32,"tag":92,"props":1071,"children":1072},{"style":105},[1073],{"type":37,"value":1074}," conversions,\n",{"type":32,"tag":92,"props":1076,"children":1078},{"class":94,"line":1077},33,[1079,1084,1089,1093,1097,1101,1106,1110,1114,1118,1122,1126,1130,1135,1139],{"type":32,"tag":92,"props":1080,"children":1081},{"style":105},[1082],{"type":37,"value":1083},"  safe_divide(",{"type":32,"tag":92,"props":1085,"children":1086},{"style":242},[1087],{"type":37,"value":1088},"c",{"type":32,"tag":92,"props":1090,"children":1091},{"style":105},[1092],{"type":37,"value":974},{"type":32,"tag":92,"props":1094,"children":1095},{"style":242},[1096],{"type":37,"value":1021},{"type":32,"tag":92,"props":1098,"children":1099},{"style":105},[1100],{"type":37,"value":250},{"type":32,"tag":92,"props":1102,"children":1103},{"style":242},[1104],{"type":37,"value":1105},"nullif",{"type":32,"tag":92,"props":1107,"children":1108},{"style":105},[1109],{"type":37,"value":763},{"type":32,"tag":92,"props":1111,"children":1112},{"style":242},[1113],{"type":37,"value":1043},{"type":32,"tag":92,"props":1115,"children":1116},{"style":105},[1117],{"type":37,"value":974},{"type":32,"tag":92,"props":1119,"children":1120},{"style":242},[1121],{"type":37,"value":1052},{"type":32,"tag":92,"props":1123,"children":1124},{"style":105},[1125],{"type":37,"value":250},{"type":32,"tag":92,"props":1127,"children":1128},{"style":242},[1129],{"type":37,"value":1061},{"type":32,"tag":92,"props":1131,"children":1132},{"style":105},[1133],{"type":37,"value":1134},")) ",{"type":32,"tag":92,"props":1136,"children":1137},{"style":481},[1138],{"type":37,"value":535},{"type":32,"tag":92,"props":1140,"children":1141},{"style":105},[1142],{"type":37,"value":1143}," cpa\n",{"type":32,"tag":92,"props":1145,"children":1147},{"class":94,"line":1146},34,[1148,1153],{"type":32,"tag":92,"props":1149,"children":1150},{"style":481},[1151],{"type":37,"value":1152},"from",{"type":32,"tag":92,"props":1154,"children":1155},{"style":105},[1156],{"type":37,"value":1157}," campaign_spend c\n",{"type":32,"tag":92,"props":1159,"children":1161},{"class":94,"line":1160},35,[1162,1167,1172,1177,1182,1186],{"type":32,"tag":92,"props":1163,"children":1164},{"style":481},[1165],{"type":37,"value":1166},"left join",{"type":32,"tag":92,"props":1168,"children":1169},{"style":105},[1170],{"type":37,"value":1171}," conversions cv ",{"type":32,"tag":92,"props":1173,"children":1174},{"style":481},[1175],{"type":37,"value":1176},"using",{"type":32,"tag":92,"props":1178,"children":1179},{"style":105},[1180],{"type":37,"value":1181}," (",{"type":32,"tag":92,"props":1183,"children":1184},{"style":481},[1185],{"type":37,"value":979},{"type":32,"tag":92,"props":1187,"children":1188},{"style":105},[1189],{"type":37,"value":1190},", campaign_id)\n",{"type":32,"tag":40,"props":1192,"children":1194},{"id":1193},"semantic-layer-создание-единого-языка",[1195],{"type":37,"value":1196},"Semantic Layer: создание единого языка",{"type":32,"tag":33,"props":1198,"children":1199},{},[1200,1202,1208,1210,1216,1218,1224,1226,1231],{"type":37,"value":1201},"Semantic layer — функция dbt, появившаяся в версии 1.6, позволяет определить метрику как код, который используют все инструменты. Метрика ",{"type":32,"tag":52,"props":1203,"children":1205},{"className":1204},[],[1206],{"type":37,"value":1207},"revenue",{"type":37,"value":1209}," — это не просто ",{"type":32,"tag":52,"props":1211,"children":1213},{"className":1212},[],[1214],{"type":37,"value":1215},"sum(order_total)",{"type":37,"value":1217},", а ",{"type":32,"tag":52,"props":1219,"children":1221},{"className":1220},[],[1222],{"type":37,"value":1223},"sum(case when payment_status = 'completed' then order_total end)",{"type":37,"value":1225},". Вопрос «Включаны ли возвраты?» исчезает, потому что определение метрики лежит на GitHub. Маркетинг, финансы, product-команды используют один метрик ",{"type":32,"tag":52,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":37,"value":1207},{"type":37,"value":1232},", только разбивают его по разным dimensions.",{"type":32,"tag":33,"props":1234,"children":1235},{},[1236,1238,1247,1249,1255],{"type":37,"value":1237},"В работах Roibase по ",{"type":32,"tag":1239,"props":1240,"children":1244},"a",{"href":1241,"rel":1242},"https:\u002F\u002Fwww.roibase.com.tr\u002Fru\u002Ffirstparty",[1243],"nofollow",[1245],{"type":37,"value":1246},"архитектуре первоточных данных и измерений",{"type":37,"value":1248}," semantic layer — обязательный шаг. Когда customer event собираются из разных touch point'ов, без фиксированных определений метрик каждый анализ даёт разный результат. В dbt semantic layer определяется в файле ",{"type":32,"tag":52,"props":1250,"children":1252},{"className":1251},[],[1253],{"type":37,"value":1254},"metrics.yml",{"type":37,"value":1256}," и предоставляется инструментам BI через API — Looker, Hex, Mode получают метрики через semantic layer, везде видна одна цифра.",{"type":32,"tag":82,"props":1258,"children":1260},{"className":84,"code":1259,"language":86,"meta":16,"style":16},"# models\u002Fmetrics\u002Fmetrics.yml\nmetrics:\n  - name: marketing_qualified_leads\n    label: Marketing Qualified Leads\n    model: ref('fct_leads')\n    calculation_method: count_distinct\n    expression: lead_id\n    timestamp: created_at\n    time_grains: [day, week, month]\n    dimensions:\n      - utm_source\n      - utm_campaign\n      - landing_page\n    filters:\n      - field: lead_status\n        operator: '='\n        value: \"'MQL'\"\n",[1261],{"type":32,"tag":52,"props":1262,"children":1263},{"__ignoreMap":16},[1264,1272,1284,1304,1321,1338,1355,1372,1389,1430,1442,1454,1466,1478,1490,1511,1528],{"type":32,"tag":92,"props":1265,"children":1266},{"class":94,"line":95},[1267],{"type":32,"tag":92,"props":1268,"children":1269},{"style":467},[1270],{"type":37,"value":1271},"# models\u002Fmetrics\u002Fmetrics.yml\n",{"type":32,"tag":92,"props":1273,"children":1274},{"class":94,"line":111},[1275,1280],{"type":32,"tag":92,"props":1276,"children":1277},{"style":99},[1278],{"type":37,"value":1279},"metrics",{"type":32,"tag":92,"props":1281,"children":1282},{"style":105},[1283],{"type":37,"value":108},{"type":32,"tag":92,"props":1285,"children":1286},{"class":94,"line":136},[1287,1291,1295,1299],{"type":32,"tag":92,"props":1288,"children":1289},{"style":105},[1290],{"type":37,"value":117},{"type":32,"tag":92,"props":1292,"children":1293},{"style":99},[1294],{"type":37,"value":122},{"type":32,"tag":92,"props":1296,"children":1297},{"style":105},[1298],{"type":37,"value":127},{"type":32,"tag":92,"props":1300,"children":1301},{"style":130},[1302],{"type":37,"value":1303},"marketing_qualified_leads\n",{"type":32,"tag":92,"props":1305,"children":1306},{"class":94,"line":154},[1307,1312,1316],{"type":32,"tag":92,"props":1308,"children":1309},{"style":99},[1310],{"type":37,"value":1311},"    label",{"type":32,"tag":92,"props":1313,"children":1314},{"style":105},[1315],{"type":37,"value":127},{"type":32,"tag":92,"props":1317,"children":1318},{"style":130},[1319],{"type":37,"value":1320},"Marketing Qualified Leads\n",{"type":32,"tag":92,"props":1322,"children":1323},{"class":94,"line":172},[1324,1329,1333],{"type":32,"tag":92,"props":1325,"children":1326},{"style":99},[1327],{"type":37,"value":1328},"    model",{"type":32,"tag":92,"props":1330,"children":1331},{"style":105},[1332],{"type":37,"value":127},{"type":32,"tag":92,"props":1334,"children":1335},{"style":130},[1336],{"type":37,"value":1337},"ref('fct_leads')\n",{"type":32,"tag":92,"props":1339,"children":1340},{"class":94,"line":185},[1341,1346,1350],{"type":32,"tag":92,"props":1342,"children":1343},{"style":99},[1344],{"type":37,"value":1345},"    calculation_method",{"type":32,"tag":92,"props":1347,"children":1348},{"style":105},[1349],{"type":37,"value":127},{"type":32,"tag":92,"props":1351,"children":1352},{"style":130},[1353],{"type":37,"value":1354},"count_distinct\n",{"type":32,"tag":92,"props":1356,"children":1357},{"class":94,"line":207},[1358,1363,1367],{"type":32,"tag":92,"props":1359,"children":1360},{"style":99},[1361],{"type":37,"value":1362},"    expression",{"type":32,"tag":92,"props":1364,"children":1365},{"style":105},[1366],{"type":37,"value":127},{"type":32,"tag":92,"props":1368,"children":1369},{"style":130},[1370],{"type":37,"value":1371},"lead_id\n",{"type":32,"tag":92,"props":1373,"children":1374},{"class":94,"line":26},[1375,1380,1384],{"type":32,"tag":92,"props":1376,"children":1377},{"style":99},[1378],{"type":37,"value":1379},"    timestamp",{"type":32,"tag":92,"props":1381,"children":1382},{"style":105},[1383],{"type":37,"value":127},{"type":32,"tag":92,"props":1385,"children":1386},{"style":130},[1387],{"type":37,"value":1388},"created_at\n",{"type":32,"tag":92,"props":1390,"children":1391},{"class":94,"line":272},[1392,1397,1402,1407,1411,1416,1420,1425],{"type":32,"tag":92,"props":1393,"children":1394},{"style":99},[1395],{"type":37,"value":1396},"    time_grains",{"type":32,"tag":92,"props":1398,"children":1399},{"style":105},[1400],{"type":37,"value":1401},": [",{"type":32,"tag":92,"props":1403,"children":1404},{"style":130},[1405],{"type":37,"value":1406},"day",{"type":32,"tag":92,"props":1408,"children":1409},{"style":105},[1410],{"type":37,"value":250},{"type":32,"tag":92,"props":1412,"children":1413},{"style":130},[1414],{"type":37,"value":1415},"week",{"type":32,"tag":92,"props":1417,"children":1418},{"style":105},[1419],{"type":37,"value":250},{"type":32,"tag":92,"props":1421,"children":1422},{"style":130},[1423],{"type":37,"value":1424},"month",{"type":32,"tag":92,"props":1426,"children":1427},{"style":105},[1428],{"type":37,"value":1429},"]\n",{"type":32,"tag":92,"props":1431,"children":1432},{"class":94,"line":318},[1433,1438],{"type":32,"tag":92,"props":1434,"children":1435},{"style":99},[1436],{"type":37,"value":1437},"    dimensions",{"type":32,"tag":92,"props":1439,"children":1440},{"style":105},[1441],{"type":37,"value":108},{"type":32,"tag":92,"props":1443,"children":1444},{"class":94,"line":331},[1445,1449],{"type":32,"tag":92,"props":1446,"children":1447},{"style":105},[1448],{"type":37,"value":191},{"type":32,"tag":92,"props":1450,"children":1451},{"style":130},[1452],{"type":37,"value":1453},"utm_source\n",{"type":32,"tag":92,"props":1455,"children":1456},{"class":94,"line":353},[1457,1461],{"type":32,"tag":92,"props":1458,"children":1459},{"style":105},[1460],{"type":37,"value":191},{"type":32,"tag":92,"props":1462,"children":1463},{"style":130},[1464],{"type":37,"value":1465},"utm_campaign\n",{"type":32,"tag":92,"props":1467,"children":1468},{"class":94,"line":366},[1469,1473],{"type":32,"tag":92,"props":1470,"children":1471},{"style":105},[1472],{"type":37,"value":191},{"type":32,"tag":92,"props":1474,"children":1475},{"style":130},[1476],{"type":37,"value":1477},"landing_page\n",{"type":32,"tag":92,"props":1479,"children":1480},{"class":94,"line":380},[1481,1486],{"type":32,"tag":92,"props":1482,"children":1483},{"style":99},[1484],{"type":37,"value":1485},"    filters",{"type":32,"tag":92,"props":1487,"children":1488},{"style":105},[1489],{"type":37,"value":108},{"type":32,"tag":92,"props":1491,"children":1492},{"class":94,"line":720},[1493,1497,1502,1506],{"type":32,"tag":92,"props":1494,"children":1495},{"style":105},[1496],{"type":37,"value":191},{"type":32,"tag":92,"props":1498,"children":1499},{"style":99},[1500],{"type":37,"value":1501},"field",{"type":32,"tag":92,"props":1503,"children":1504},{"style":105},[1505],{"type":37,"value":127},{"type":32,"tag":92,"props":1507,"children":1508},{"style":130},[1509],{"type":37,"value":1510},"lead_status\n",{"type":32,"tag":92,"props":1512,"children":1513},{"class":94,"line":728},[1514,1519,1523],{"type":32,"tag":92,"props":1515,"children":1516},{"style":99},[1517],{"type":37,"value":1518},"        operator",{"type":32,"tag":92,"props":1520,"children":1521},{"style":105},[1522],{"type":37,"value":127},{"type":32,"tag":92,"props":1524,"children":1525},{"style":130},[1526],{"type":37,"value":1527},"'='\n",{"type":32,"tag":92,"props":1529,"children":1530},{"class":94,"line":745},[1531,1536,1540],{"type":32,"tag":92,"props":1532,"children":1533},{"style":99},[1534],{"type":37,"value":1535},"        value",{"type":32,"tag":92,"props":1537,"children":1538},{"style":105},[1539],{"type":37,"value":127},{"type":32,"tag":92,"props":1541,"children":1542},{"style":130},[1543],{"type":37,"value":1544},"\"'MQL'\"\n",{"type":32,"tag":40,"props":1546,"children":1548},{"id":1547},"exposures-открытие-в-production",[1549],{"type":37,"value":1550},"Exposures: открытие в production",{"type":32,"tag":33,"props":1552,"children":1553},{},[1554,1556,1561,1563,1569],{"type":37,"value":1555},"Exposures — механизм dbt для отслеживания downstream-зависимостей: вы определяете, какой дашборд питается от какой dbt-модели. На Looker есть дашборд «Weekly Campaign Performance», который берёт данные из ",{"type":32,"tag":52,"props":1557,"children":1559},{"className":1558},[],[1560],{"type":37,"value":428},{"type":37,"value":1562},". В dbt это пишется в файл ",{"type":32,"tag":52,"props":1564,"children":1566},{"className":1565},[],[1567],{"type":37,"value":1568},"exposures.yml",{"type":37,"value":1570},". Теперь, если вы захотите внести breaking change в модель, dbt предупредит вас: «Эта модель используется в 3 дашбордах, проведите анализ влияния».",{"type":32,"tag":33,"props":1572,"children":1573},{},[1574],{"type":37,"value":1575},"Exposures появляются и в документации — на странице модели в dbt docs видно «Used in 5 dashboards, 2 reverse ETL jobs, 1 ML pipeline». Lineage данных протягивается вплоть до слоя BI. Вы знаете, какой дашборд питается от какого SQL. Время отладки снижается, потому что вы находите проблемный дашборд и прослеживаете его до исходной модели.",{"type":32,"tag":1577,"props":1578,"children":1579},"table",{},[1580,1604],{"type":32,"tag":1581,"props":1582,"children":1583},"thead",{},[1584],{"type":32,"tag":1585,"props":1586,"children":1587},"tr",{},[1588,1594,1599],{"type":32,"tag":1589,"props":1590,"children":1591},"th",{},[1592],{"type":37,"value":1593},"Тип Exposure",{"type":32,"tag":1589,"props":1595,"children":1596},{},[1597],{"type":37,"value":1598},"Использование",{"type":32,"tag":1589,"props":1600,"children":1601},{},[1602],{"type":37,"value":1603},"Способ отслеживания",{"type":32,"tag":1605,"props":1606,"children":1607},"tbody",{},[1608,1627,1645,1663],{"type":32,"tag":1585,"props":1609,"children":1610},{},[1611,1617,1622],{"type":32,"tag":1612,"props":1613,"children":1614},"td",{},[1615],{"type":37,"value":1616},"Dashboard",{"type":32,"tag":1612,"props":1618,"children":1619},{},[1620],{"type":37,"value":1621},"Looker, Tableau, Metabase",{"type":32,"tag":1612,"props":1623,"children":1624},{},[1625],{"type":37,"value":1626},"URL + model ref",{"type":32,"tag":1585,"props":1628,"children":1629},{},[1630,1635,1640],{"type":32,"tag":1612,"props":1631,"children":1632},{},[1633],{"type":37,"value":1634},"Reverse ETL",{"type":32,"tag":1612,"props":1636,"children":1637},{},[1638],{"type":37,"value":1639},"Census, Hightouch",{"type":32,"tag":1612,"props":1641,"children":1642},{},[1643],{"type":37,"value":1644},"Job ID + source table",{"type":32,"tag":1585,"props":1646,"children":1647},{},[1648,1653,1658],{"type":32,"tag":1612,"props":1649,"children":1650},{},[1651],{"type":37,"value":1652},"ML Pipeline",{"type":32,"tag":1612,"props":1654,"children":1655},{},[1656],{"type":37,"value":1657},"Vertex AI, SageMaker",{"type":32,"tag":1612,"props":1659,"children":1660},{},[1661],{"type":37,"value":1662},"Model name + feature table",{"type":32,"tag":1585,"props":1664,"children":1665},{},[1666,1671,1676],{"type":32,"tag":1612,"props":1667,"children":1668},{},[1669],{"type":37,"value":1670},"Operational Tool",{"type":32,"tag":1612,"props":1672,"children":1673},{},[1674],{"type":37,"value":1675},"Braze, Iterable — сегменты кампаний",{"type":32,"tag":1612,"props":1677,"children":1678},{},[1679],{"type":37,"value":1680},"Segment ID + dbt model",{"type":32,"tag":40,"props":1682,"children":1684},{"id":1683},"pipeline-orchestration-расписание-каждого-слоя",[1685],{"type":37,"value":1686},"Pipeline Orchestration: расписание каждого слоя",{"type":32,"tag":33,"props":1688,"children":1689},{},[1690],{"type":37,"value":1691},"Pipeline управляется через dbt Cloud Scheduler или Airflow. В 6:00 утра сырые данные загружаются в BigQuery (Fivetran, Stitch, Airbyte), в 6:30 запускается dbt run. Staging-модели выполняются за 5 минут, intermediate за 10, mart за 15. В 7:00 semantic layer раскрывается, в 7:15 дашборды Looker обновляются. Когда команда приходит в 9:00, вчерашние данные уже видны — никакого 3-часового лага pipeline.",{"type":32,"tag":33,"props":1693,"children":1694},{},[1695,1697,1703,1704,1710,1711,1717,1718,1724,1726,1731],{"type":37,"value":1696},"Test suite запускается при каждом run: ",{"type":32,"tag":52,"props":1698,"children":1700},{"className":1699},[],[1701],{"type":37,"value":1702},"not_null",{"type":37,"value":250},{"type":32,"tag":52,"props":1705,"children":1707},{"className":1706},[],[1708],{"type":37,"value":1709},"unique",{"type":37,"value":250},{"type":32,"tag":52,"props":1712,"children":1714},{"className":1713},[],[1715],{"type":37,"value":1716},"accepted_values",{"type":37,"value":250},{"type":32,"tag":52,"props":1719,"children":1721},{"className":1720},[],[1722],{"type":37,"value":1723},"relationships",{"type":37,"value":1725},". Если в таблице ",{"type":32,"tag":52,"props":1727,"children":1729},{"className":1728},[],[1730],{"type":37,"value":57},{"type":37,"value":1732}," campaign_id не уникален, dbt run считается провалом. Alert падёт в Slack. Data quality gate'ы enforced на уровне кода. Сломанные данные в production не попадают.",{"type":32,"tag":82,"props":1734,"children":1736},{"className":84,"code":1735,"language":86,"meta":16,"style":16},"# dbt_project.yml on-run-end hooks\non-run-end:\n  - \"{{ log_dbt_results() }}\"\n  - \"{{ send_slack_notification() }}\"\n  - \"{{ update_looker_cache() }}\"\n",[1737],{"type":32,"tag":52,"props":1738,"children":1739},{"__ignoreMap":16},[1740,1748,1760,1772,1784],{"type":32,"tag":92,"props":1741,"children":1742},{"class":94,"line":95},[1743],{"type":32,"tag":92,"props":1744,"children":1745},{"style":467},[1746],{"type":37,"value":1747},"# dbt_project.yml on-run-end hooks\n",{"type":32,"tag":92,"props":1749,"children":1750},{"class":94,"line":111},[1751,1756],{"type":32,"tag":92,"props":1752,"children":1753},{"style":99},[1754],{"type":37,"value":1755},"on-run-end",{"type":32,"tag":92,"props":1757,"children":1758},{"style":105},[1759],{"type":37,"value":108},{"type":32,"tag":92,"props":1761,"children":1762},{"class":94,"line":136},[1763,1767],{"type":32,"tag":92,"props":1764,"children":1765},{"style":105},[1766],{"type":37,"value":117},{"type":32,"tag":92,"props":1768,"children":1769},{"style":130},[1770],{"type":37,"value":1771},"\"{{ log_dbt_results() }}\"\n",{"type":32,"tag":92,"props":1773,"children":1774},{"class":94,"line":154},[1775,1779],{"type":32,"tag":92,"props":1776,"children":1777},{"style":105},[1778],{"type":37,"value":117},{"type":32,"tag":92,"props":1780,"children":1781},{"style":130},[1782],{"type":37,"value":1783},"\"{{ send_slack_notification() }}\"\n",{"type":32,"tag":92,"props":1785,"children":1786},{"class":94,"line":172},[1787,1791],{"type":32,"tag":92,"props":1788,"children":1789},{"style":105},[1790],{"type":37,"value":117},{"type":32,"tag":92,"props":1792,"children":1793},{"style":130},[1794],{"type":37,"value":1795},"\"{{ update_looker_cache() }}\"\n",{"type":32,"tag":40,"props":1797,"children":1799},{"id":1798},"tradeoff-сложность-vs-управление",[1800],{"type":37,"value":1801},"Tradeoff: сложность vs управление",{"type":32,"tag":33,"props":1803,"children":1804},{},[1805],{"type":37,"value":1806},"dbt + BigQuery stack вносит сложность. SQL-знания становятся обязательными для аналитиков — «сделаю pivot в Excel» больше не работает. Git workflow, code review, CI\u002FCD — всё это нужно изучать. Для маленьких команд этот overhead дорого стоит. Но tradeoff явный: вы получаете governance. Вместо потерянной формулы в spreadsheet — версионируемый код. На вопрос «Откуда эта цифра?» Git blame даст ответ за 10 секунд.",{"type":32,"tag":33,"props":1808,"children":1809},{},[1810,1812,1818,1820,1826],{"type":37,"value":1811},"BigQuery создаёт другой tradeoff. Full table scan'ы дорогие — partition и cluster стратегия обязательны. В dbt incremental-моделях конфиг ",{"type":32,"tag":52,"props":1813,"children":1815},{"className":1814},[],[1816],{"type":37,"value":1817},"partition_by",{"type":37,"value":1819}," и ",{"type":32,"tag":52,"props":1821,"children":1823},{"className":1822},[],[1824],{"type":37,"value":1825},"cluster_by",{"type":37,"value":1827}," критичен. Pipeline, обрабатывающий 100 GB данных в месяц, требует в BigQuery $50 на slot'ы + $5 storage. Managed service исключает infra-overhead, но без query optimization счёт растет.",{"type":32,"tag":33,"props":1829,"children":1830},{},[1831],{"type":37,"value":1832},"Связывание маркетинговых данных с механизмом принятия решений — это уже не задача для spreadsheet и BI tool. dbt + BigQuery stack кодифицирует каждый слой — от source до exposure. Source mapping обеспечивает надёжность сырых данных, modeling layer применяет бизнес-логику, semantic layer создаёт общий язык, exposures открывают данные в production. Pipeline управляется с дисциплиной software engineering.",{"type":32,"tag":1834,"props":1835,"children":1836},"style",{},[1837],{"type":37,"value":1838},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":16,"searchDepth":136,"depth":136,"links":1840},[1841,1842,1843,1844,1845,1846],{"id":42,"depth":111,"text":45},{"id":393,"depth":111,"text":396},{"id":1193,"depth":111,"text":1196},{"id":1547,"depth":111,"text":1550},{"id":1683,"depth":111,"text":1686},{"id":1798,"depth":111,"text":1801},"markdown","content:ru:data:dbt-bigquery-sovremennyi-stack-marketingovyh-dannyh.md","content","ru\u002Fdata\u002Fdbt-bigquery-sovremennyi-stack-marketingovyh-dannyh.md","ru\u002Fdata\u002Fdbt-bigquery-sovremennyi-stack-marketingovyh-dannyh","md",1778392983788]